davidstutz / bootstrap-multiselect

JQuery multiselect plugin based on Twitter Bootstrap.
https://davidstutz.github.io/bootstrap-multiselect/
Other
3.67k stars 1.98k forks source link

Adding multiselect option at runtime #954

Open GJoshi27 opened 7 years ago

GJoshi27 commented 7 years ago

Hi,

Instead of adding multiselect in static html page, I want to add on a click of a button. Like this: var cell1=row.insertCell(0); var el=document.createElement('select'); el.class = 'selectpicker'; el.width = '200 px'; el.id = 'cell1'+iteration; cell1.appendChild(el);

Is there a way to do it using bootstrao multiselect?

davidstutz commented 6 years ago

Well I don't really understand your JavaScript code without context. But yes, you can do this; simply manually create a select element (using standard jQuery) and then call the multiselect after adding it to the DOM. Or did I misunderstand your problem?

kingdeejaymes commented 6 years ago

Hi -

Same plan to implement on the first question. I'd like to dynamically load options in the multiselect and I was successful doing that. However, upon triggering to open the drop-down, it cannot load the items in the list of options in the select tag. Inspecting the html, it seem's that the plugin didn't include the added options in the

Nishantsaini04 commented 5 years ago

Hi ,

I am facing same issue. Have you resolved it please explain