Hello,
I have a grid with the following features:
- Paging- Selection- RowSelectors
On the first page I select all rows then I click on my "Clear Selection" button ($('#grid1').igGridSelection('clearSelection');).Selection appears empty but when I go to page 2 then come back on page 1, all rows are selected.
Please find an example in attachement.
Thanks for your help,
Olivier
Hello Olivier,
This issue has been resolved with the later versions. If you change your loader's scriptPath and cssPath to point to the latest service release like this:
$.ig.loader({ scriptPath: "http://cdn-na.infragistics.com/jquery/20121/latest/js/", cssPath: "http://cdn-na.infragistics.com/jquery/20121/latest/css/", resources: "igGrid.Filtering,igCombo,igGrid.*" });
Clear Selection will then work as expected.
Thank you for using the Infragistics forums!
Best regards,
Stamen Stoychev
Ok it works! But with paging, "clear" only works on the current page. Is it possible to clear the entire selection (not displayed pages) ?
Clear Selection, similar to the rest of the Selection API works on the current page only. Your selection state is stored and reapplied when changing the page index because RowSelectors are initialized with the checkbox feature enabled. One of the functions of the RowSelectors checkboxes is to store and reapply selection after Paging.
With this said, the easiest way to disable the automatic selection storage is by simply disabling the RowSelectors checkboxes. If you, however, need the checkboxes enabled, I'll provide you with a custom solution that will clear the internal selection cache stored by the RowSelectors when you call "clearSelection". Please let me know if disabling the checkboxes is not a desired solution!
I have to provide a checkbox for each row. When the user rebind the grid (by clicking on a button) the selection must cleared.
What is the most appropriate? I tried to use the events PageIndexChanging and PageIndexChanged. Is this the right way?
Regards,
Thank you for your help, I could solve all the issue with row selection:
- Define an initial selection (with paging)- Keep selection after sorting or filtering- Clear selection rebind
Hello aldup,
I'm just following up to see if you have any other questions or concerns or if you need further assistance.
If so please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Hello aldup ,
The selection is cleared by design when you change the page size and that behavior can’t be changed but you should be able to reapply the selection you’ve saved during the pageSizeChanged event.
Let me know if you happen to come across any issues or if you have any questions.
Thanks ! Finally I maintain an array of my selection with the event "checkBoxStateChanged".
However when the user changes the page size the current selection is lost. If I want to keep the selection my only option is to use the event "pageSizeChanged" ?
Olivier,
Hi Olivier,
If you have any other questions, please feel free to contact us.