Home › Forums › Guriddo jqGrid JS › Help › Maintaining checkbox selections through a page operation
I have a multi-select jqGrid that I'm using and the user has asked me if there is a way to maintain the list of checked items after the next page is selected.
Hello,
You will need to use onPaging event again with getGridParam to obtain the selected rows in multiselect mode.
Best Regards
Tony
Hi Tony,
I am also trying to achieve the same effect of preserving row selection across pages. I tried following you above suggestion with something like:
onPaging: function () {
This is true, since of the reference to the selected columns which after populating we become empty array.
To work this you should do something like this:
onPaging: function() {
var myselectedrows = $.extend([], $(“#grid”).jqGrid(“getGridParam”, “selarrrow”));
}
The above still returns “[]” for me in 3.5.6. Does it work for you?
Best,
Keith
Sorry, it is a my fault. I do not have looked into the code.
It is true. This will not work. I have fixed this and you will have the change tomorrow in GitHub.
I also can not get this to work in 3.6.4…
Please use the latest version from GitHub
Here is the fix:
http://github.com/tonytomov/jqGrid/commit/d2b668c2555a2c1369dbfd906ae0ec9d760ac50c
Regards
Thanks Tony 🙂
Are there any plans to automate this in future versions of jqGrid?
When it is in github it means that it will be in the next release.
Try as I might, I cannot get selections from different pages to persist.
Hi Toucan,
Here is the code I'm using to keep track of things:
http://pastebin.com/1Yyf07xA has functions like _addIdsToSelectedCache and _removeIdsFromSelectedCache which are not
Stay connected with us in your favorite flavor!
Copyright 2014 TriRand LtdAll Rights ReservedRSS