I have two sets of dojo.form.Multiselect boxes on a Wizard Dialog. They have the ability to transfer items between them like this example: Testing Multiselect from Widget. I also have a checkbox on the form and when a user clicks on it, I need to:
The invsertSelection option doesn't work because if any items are selected at the time the checkbox is clicked, only the unselected items are selected and moved. I don't see a way in the API to do this nor a reliable method in the codesphere. Any suggestions?
Figured out a solution from looking at Dojo Docs and other code:
var selectItem1 = dijit.byId('firstSelectBox');
// Deselect all and invert to Select all
selectItem1.set("value",[]);
selectItem1.invertSelection();
//Move items to right box
var selectItem2 = dijit.byId('secondSelectBox');
selectItem2.addSelected(selectItem1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With