Flyer53 / jsPanel3

A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
http://v3.jspanel.de/
Other
89 stars 21 forks source link

Can't get current value of elements inside panel. #41

Closed jose-gomez closed 7 years ago

jose-gomez commented 7 years ago

On using the following code creating a panel:

  myPanel = $.jsPanel({
                            position: {
                                my: "left-top",
                                at: "left-bottom",
                                of: "#btntoolbar" // the button executing this example
                            },
                            contentSize: { width: 400, height: 100 },
                            headerTitle: 'Opciones',
                            content:"  Filtrar por año:  <input type='checkbox' />    <select id='YearOptions' class='some_select' onchange=' alert(YearOptions.value)'  >   <option value='317'>2017</option> <option value='1016'>2016</option> </select>",
                            headerControls: { controls: "none" }
                        })

It's nearly impossible to get the current value of a dropdown, or an input when a selection or text is changed. Is there anything I'm missing here?

Flyer53 commented 7 years ago

What did you try so far to get a value? I copied your example and then called for example:

var cb = $('input', myPanel.content)[0].checked;
var sel = $('#YearOptions', myPanel.content).val();

console.log(cb, sel);

and it works just fine.

Flyer53 commented 7 years ago

@jose-gomez Since you didn't answer to this for almost 4 months I consider this issue done ...