bootstrap-duallistbox icon indicating copy to clipboard operation
bootstrap-duallistbox copied to clipboard

Move elements between List programmatically

Open abel-dominguez-ruiz opened this issue 9 years ago • 3 comments

Hi everyone, I'd like to know how can I do the swapping movement between 2 List programmatically but I didnt find the function or way to do that.

Thank you.

abel-dominguez-ruiz avatar Apr 14 '15 11:04 abel-dominguez-ruiz

This may help:

Change the options you want moved to selected (or unselected). $('#select-list option[value="somevalue"]').attr('selected',true);

Then refresh the bootstrapDualListbox. yourListboxVariableName.bootstrapDualListbox('refresh', true);

This approach is working very well for me.

jfgrissom avatar Apr 27 '15 17:04 jfgrissom

Hello jfgrissom,

This approach is not working on firefox.

bhumiradixweb avatar Oct 13 '15 12:10 bhumiradixweb

Try this:

$('#myselect').val(["value1", "value3", "value5"]);
$('#myselect').bootstrapDualListbox('refresh', true);

eonardol avatar Jan 29 '18 11:01 eonardol