开发者

EXT-JS: datastore get all rows

开发者 https://www.devze.com 2023-02-09 15:33 出处:网络
I have an datastore assigned to an table through an PagingToolbar. The paging size is limited to 10 per page. Now I want to create an export-function which exports all entries of this datastore.

I have an datastore assigned to an table through an PagingToolbar. The paging size is limited to 10 per page. Now I want to create an export-function which exports all entries of this datastore.

I have done the following code:

var countRows  = dataSource.getCount();
var csvData    = new Array();
for ( var row = 0; row < countRows; row++ ) {
  csvDa开发者_Python百科ta.push( dataSource.getAt( row ).data[ 'messageID' ] ) );
}

this works fine, but only for the visible rows. If I change the first line to

var countRows  = dataSource.getTotalCount();

I get the right count of total rows, but when I want to access a row, that is not currently shown, I get an exception.

Any Ideas?


Only rows that are currently being shown in your grid are actually loadd into the store. That's how paging work. If you'd like to get all rows, you need to load them from the server first.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号