In an igCombo you can select one item in the dropdown, then hold down the Shift key while selecting another item, and the first item and last item and all items in between are selected.
I am using an igTree with checkboxes. After expanding a particular node I would like to select multiple children using a similar method - ie. selecting one item, then selecting another under the same node while holding down the shift key, then all in between are automatically selected.
Is this functionality available for an igTree, and it so, how would it be implemented?
Hello Ray,
I am gla that you managed to achieve your requirement.
Thank you for using Infragistics components.
I appreciate your assistance. I added the event but it was never triggered. Instead I had to use the nodeCheckstateChanging event. I decided to do something slightly different from my original proposal, but your suggestions definitely helped. Thanks again.
Thank you for posting in our community.
At this point we do not provide out of the box way to select range of nodes while holding "Shift" key.
Alternatively, what I can suggest is handling selectionChanging event of the igTree where you have a reference to both currently selected and the newly selected nodes. Additionally, via the ui argument you can get reference whether the selection was changed while Shift key was pressed. If the Shift key was pressed and you calculate the nodes in between the currently selected and newly selected once you can loop trough the delta collection and manually check them using checkNode method. For example:
selectionChanging: function(evt, ui) { var currentNodes = ui.selectedNodes, newlySelected = ui.newNodes, nodesToSelect = //TODO Find all noodes between the currently and the newly selected; if(evt.originalEvent.shiftKey) { nodesToSelect.each(function(index){ ui.owner.checkNode(nodesToSelect[i]); }) } },
Hope you will find this approach helpful.Please let me know if you need any further assistance with this matter.