bootstrap-duallistbox
bootstrap-duallistbox copied to clipboard
Move elements between List programmatically
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.
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.
Hello jfgrissom,
This approach is not working on firefox.
Try this:
$('#myselect').val(["value1", "value3", "value5"]);
$('#myselect').bootstrapDualListbox('refresh', true);