javascript - JQuery Mobile selectmenu() multiple option true/false -> not refreshing the displaying of choices -


regarding jquery , jquerymobile,

code in jsfiddle link: https://jsfiddle.net/nyluje/jg5cgw76/7/

i use flipswitch change, if select object has attribute multiple or not.

at first flipswitch off , attribute multiple not apply on select.

if use select, can choose 1 single option (this works fine).

then turn flipswitch on. code implemented in function setselectaccordingtofs() attribute multiple added select , possible pickup multiple options. 1 notices pop-up, not native menu one, not display multiple select correctly, on picture:

multiple select should be

it keeps on displaying single select panel. allow add options, does not provide possibility take off some:

multiple select on single select panel

hence wonder: how refresh select panel menu used select, depending on attribute multiple value:'off' or 'on', on select tag?

any idea?

ok found solution. implemented in version of jsfiddle: https://jsfiddle.net/nyluje/jg5cgw76/8/

the trick: using option 'refresh' wasn't enough. (really) refresh selectmenu and include panel in refresh, 'destroy' , 'enable' functionnalities have used. @ bottom of function setselectaccordingtofs() added that:

    targetselect.selectmenu('destroy');          targetselect.selectmenu();     targetselect.selectmenu('enable');           targetselect.selectmenu('refresh',true); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -