jqGrid
jqGrid copied to clipboard
Pager not updating with gridDnD
http://jsfiddle.net/ht16273t/
As the above Fiddle demonstrates, moving rows between grids doesn't seem to update each grid's pagination. This leads to pages not being added in the destination (and the row seemingly being lost) and all kind of oddness in the source. I'd think this could be resolved with a reloadGrid on each but the ondrop event, according to the documentation, doesn't pass the source or target grid to work with the way beforedrop does.
Thanks for the investigation. It seems that update pager should be call on both grids after drag and drop. I will test this and replay to this issue.
Just FYI, I tested this through moving rows with dblclick and binded "enter" and the same problem exists.
For instance, say I have a grid with 100 items and a rowNum of 10, it'll be 10 pages of 10 rows. Moving rows from page 1 to another grid via addRowData/delRowData or via DnD, the contents of page 1 will reduce to nothing. I'll remain on an empty page 1 of 10.
I think the expected behavior would be that when a row moves from that grid, the following items "move up". Page 1 would retain 10 rows with one coming from page 2, and now page 10 only has 9 rows.
Conversely, if the second grid similarly has rowNum of 10, the 11th item moved to it would create a page 2.
So it's not exactly limited to DnD. It's something that should probably be reconciled every time addRowData/delRowData is used. Calling reloadGrid after the moves seems to accomplish this.