I am still struggling to understand how jqGrid works with multiselect.
When I thought I knew everything about it, again another problem.
Here you can find an example of what’s happening.
I want to preselect some rows in a multiselect grid.
If you click the button it will tell you that you have 13 rows selected. Very good.
Now, if you check all the rows using the “SelectAll” button you’ll find out that the rows selected are 40.
The problem is the grid only has 29 rows :-s
It’s like it keeps the previous selection and adds the new rows selected.
Any help would be really really appreciated.
Your code demonstrate the bug in jqGrid 3.8.2. jqGrid must reset
selarrrowto empty array[]:before the filling ids of all selected rows. I verified that the bug is already fixed in the code of jqGrid on the github.com: see here. So if you use developer version of jqGrid you can just add in the code of jqGrid 3.8.2 the line. Alternative you can get the last (can be not so good tested code) from the github.com or wait for the next release of jqGrid. 🙂