Hi,
We need to programatically de-select a particular node in the ListView control. Listview has option - selectable: "multiple". We don't want to use clearSelection() as it will remove selection for all the nodes.
Please let me know how we can achieve this.
Thanks a lot.
We need to programatically de-select a particular node in the ListView control. Listview has option - selectable: "multiple". We don't want to use clearSelection() as it will remove selection for all the nodes.
Please let me know how we can achieve this.
Thanks a lot.
5 Answers, 1 is accepted
0
Hello Abhishek,
In the current case you should use the select() method and select all required nodes without the one that should be deselected.
Let me know if this was the information that you were looking for.
Regards,
Dimiter Madjarov
Telerik
In the current case you should use the select() method and select all required nodes without the one that should be deselected.
Let me know if this was the information that you were looking for.
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Abhishek
Top achievements
Rank 1
answered on 29 Sep 2014, 05:19 PM
Hi Dimiter,
I tried your suggestion but could not achieve the item de-selection.
This is the code I tried -
var remainingElementsToSelect = listView.select().not(itemToDeSelect);
listView.select(remainingElementsToSelect);
But still the 'itemToDeSelect' remains selected.
Thanks in advance.
I tried your suggestion but could not achieve the item de-selection.
This is the code I tried -
var remainingElementsToSelect = listView.select().not(itemToDeSelect);
listView.select(remainingElementsToSelect);
But still the 'itemToDeSelect' remains selected.
Thanks in advance.
0
Accepted
Hi Abhishek,
Please excuse me for the inconvenience. I missed the fact that the select() method does not override the selection, but only adds to the existing one. I would suggest to clear the current selection, before applying the new one.
E.g.
Regards,
Dimiter Madjarov
Telerik
Please excuse me for the inconvenience. I missed the fact that the select() method does not override the selection, but only adds to the existing one. I would suggest to clear the current selection, before applying the new one.
E.g.
var
remainingElementsToSelect = listView.select().not(itemToDeSelect);
listView.clearSelection();
listView.select(remainingElementsToSelect);
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Abhishek
Top achievements
Rank 1
answered on 30 Sep 2014, 02:49 PM
Thanks Dimiter. It solved the issue successfully!.
Thanks a lot.
Thanks a lot.
0
Hello Abhishek,
I am glad the solution resolved the issue.
Have a great day!
Regards,
Dimiter Madjarov
Telerik
I am glad the solution resolved the issue.
Have a great day!
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!