EasyUI Forum

General Category => Bug Report => Topic started by: hande89 on November 25, 2014, 05:59:25 AM



Title: Treegrid getData
Post by: hande89 on November 25, 2014, 05:59:25 AM
http://www.jeasyui.com/easyui/demo/treegrid/clientpagination.html

Why does the treegrid return only current page rows when calling getData method if pagination is in use?

Datagrid is returning the whole data: http://www.jeasyui.com/easyui/demo/datagrid/clientpagination.html


Title: Re: Treegrid getData
Post by: jarry on November 25, 2014, 08:06:52 AM
Calling 'getData' method on the datagrid returns only the current page rows.
Code:
var d = $('#dg').datagrid('getData');
console.log(d);


Title: Re: Treegrid getData
Post by: hande89 on November 25, 2014, 09:56:06 AM
But the object returned by datagrid getData has property originalRows, treegrid getData doesn't have it.


Title: Re: Treegrid getData
Post by: jarry on November 26, 2014, 12:41:17 AM
If you want to get all the loaded rows, please call 'getAllRows' method instead.
Code:
var r1 = $('#dg').datagrid('getAllRows');
var r2 = $('#tg').treegrid('getAllRows');


Title: Re: Treegrid getData
Post by: hande89 on November 26, 2014, 01:21:53 PM
Ok, but it was undocumented...


Title: Re: Treegrid getData
Post by: jarry on November 26, 2014, 03:15:49 PM
These two examples only show how to achieve the client paging. This is not the core feature.