ExtJS: Limiting the number of rows on a GridPanel
I have a grid panel that loads data through a XML store. I cannot control how many i开发者_运维知识库tems the XML will return, but I want to limit the grid to showing x number of rows.
Sorry if this is basic, I couldnt find it via google
Cheers
Do you not want to show the rows beyond x for performance / too much data to visualize reason or do you want to really hide the records beyond x from the users?
If former, you can just setup pagination (it's pretty straight forward)
More info here -
http://dev.sencha.com/deploy/dev/examples/grid/paging.html
If later, you can use bensiu's suggestion. (using getRange())
Just use getRange () method in Store (XmlStore) when load data to GridPanel
精彩评论