DualListBox icon indicating copy to clipboard operation
DualListBox copied to clipboard

No added value on right side

Open jeraldpunx opened this issue 9 years ago • 6 comments

How to load already value on right side, this docu lack some tutorials

jeraldpunx avatar Dec 23 '15 01:12 jeraldpunx

I have the same problem, any solution?

cettinaraja avatar Jan 07 '16 09:01 cettinaraja

Currently this loads them all in the 'selected' pile, which makes zero sense. They should all be unselected initially.

Trasiva avatar Jan 14 '16 23:01 Trasiva

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 ?

godselevator avatar Mar 03 '16 09:03 godselevator

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); }); })

cettinaraja avatar Mar 04 '16 08:03 cettinaraja

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.

SimpleDualListBoxNoJSON.txt

So "Item 2" and "Item 4" would be loaded into the "selected" list on the right.

mjruether avatar Mar 08 '16 16:03 mjruether

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

balushalu avatar Apr 07 '17 07:04 balushalu