DualListBox
DualListBox copied to clipboard
No added value on right side
How to load already value on right side, this docu lack some tutorials
I have the same problem, any solution?
Currently this loads them all in the 'selected' pile, which makes zero sense. They should all be unselected initially.
Can someone tell me which data- attribute to use for already selected items (items that initially should go to the right sided listbox ? Or maybe an exampe of how to initialize the control via the selected parameter ?
Hi godselevator, this is my code... I hope can help you.
var restUriAllComparator="<%=request.getContextPath()%>/rest/allComparator"; $(function(){ $.getJSON(restUriAssociatedComparator, function(data) { var conf = {uri: restUriAllComparator}; $("#duallistcontainer").html(""); /* console.log(JSON.stringify(data)); */ $( "#duallistcontainer" ).append('<div id="dual-list-box" class="form-group row"><select id="dual" multiple="multiple" data-value="id" data-text="description"></select> </div>'); $("#dual").DualListBox(conf,data); }); })
Here's an example to load items without using a JSON datasource. You just need to add the "selected" attribute to the options you want on the right.
So "Item 2" and "Item 4" would be loaded into the "selected" list on the right.
hi mjruether, I have a arraylist which is used as datasourece, in which there are few items that are selected and saved in DB. The arraylist is returned to the control as JSON data. Now how to append the selected items in that arraylist on to the Right side List box, Please help here as i am stuck