tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

Fixed pagination issue in treegrid #964

Closed avnish1306 closed 4 years ago

avnish1306 commented 4 years ago

When the grid type is tree grid and pagination is true then th "rowNum" which is number of rows in a page is getting changed to 10000 because there is a mistake in setTreeGrid function as if($t.p.rowTotal === null ) { $t.p.rowNum = 10000; } $t.p.rowNum =10000 should be $t.p.rowTotal = 10000;

avnish1306 commented 4 years ago

treeGridIssue

tonytomov commented 4 years ago

Can you please provide a example which demonstrates this problem (Please provide a real demo example with data).

Moreover I see you use a old version of jqGrid as seen into the pickture

avnish1306 commented 4 years ago

Since my ongoing project is not on web so i created a demo which will be sufficient to show the issue.

rowNum is set to 2, so the grid should show 2 record/page as it is expected behavior but it's showing all the records. But after my fix that i proposed the page is showing the expected behavior. You can navigate to this to see yourself https://codepen.io/avnishawi/pen/LYEoYRL. I'm also attaching the screenshots which will show before correction , after correction output and also the debugger. beforeCorrection1 afterCorrection debugging

tonytomov commented 4 years ago

The version you use does not support paging (as per problem reported) and rowNum parameter does not have sense in treeGrid that is the reason to be set a relative big number - this is the behaviour prior to version 5.3. As of version 5.3 we support paging under certain conditions. Please see this documentation - http://www.guriddo.net/documentation/guriddo/javascript/user-guide/treegrid/#paging

P.S. In your case if yo want to load 2 nodes just set rowTotal and rowNum to 2. The version 4.6 you use is very old and is no more supported.