javascript - Dynamically loading combo box values -


i have combobox on change triggers ajax call , fetches few values. these values used create combobox.

the code below used dynamically load options of combobox:

function appendoption(select,option) {     try {         alert(select.innerhtml+"--select--"+option.innerhtml+"--option");         alert(select.add(option, null)); // shows option tag formed         select.add(option, null); // not adding option element combo     } catch (e) {         alert(e.message());     } } 

the select object inside method valid object.

i have used chosen-select jquery plugin creating combo box. above method working fine in case of normal combo (not chosen-select).

can please me?

if problem "select control not populating added option" need add $('.my_select_box').trigger('chosen:updated'); method once finish adding options. in case after add method.

chosen control need told changes made them.so calling above update trigger tells chosen control changed re render it.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -