-
9 Oct 2007 8:40 AM #1
Editor Grid - Paging Shows All Records
Editor Grid - Paging Shows All Records
I've read post after post and tried to follow the examples to the letter (Tutorial, Docs, forum) but I'm banging my head against the wall with paging the editor grid. I've managed filtering, adding rows, editing in line but paging is killing me so I'd be eternally grateful for some help.
Preliminary question: Is the paging done server-side with the offset and limit passed back to the server going into say a SQL query's limits or is it done client side with the whole dataset?
I've tried doing it both ways:
1. Server Side
I tried using the "start" and "limit" post data in my SQL query on the server which then returned 10 records as expected. I then did a query to find the total number of fields in the table which in my case was 16. So my JSON returned:
However, the grid displayed just the 10 records and said only 10 were available. So no paging.Code:({"total":"16",plans:[{"planid":"1","lenderid":"3","lendername":"EPF","loantype":"1",[...]
Then I tried....
2. Client Side
I ignore the "start" and "offset" values sent back as post data and simply send all records to the grid. Now I have something more promising because the grid detects all 16 records and that it should be put across 2 pages as it enables the paging button and shows "1 - 2" for the pages. However, it shows all the records - so its not paged. If I go to page 2 it just shows them all again.
So neither way works - I'm hoping someone could let me know what I'm doing wrong? If you need to see my code then let me know what part and I'll post it up - I just don't want to swamp you all with it in one go.
-
9 Oct 2007 11:45 AM #2
pagins is handled on the server side; the idea is to reduce the amount of data exchanged with the client.
it would help to see the config for your store and reader objects, particularly the reader's totalProperty property.
-
10 Oct 2007 2:32 AM #3
-
13 Mar 2008 8:12 AM #4
Hi to you all!!
I am facing the same problem, I have a grid full of data.
Let's say, 10 columns and almost 600 lines (records), but these ones are going to grow.
I want to paginate my grid with 20 records per time, but I am not able to setup Ext.PagingToolbar properly.
I mean, I took it form Extjs example, and it is:
My store is set this way:PHP Code:var paging = new Ext.PagingToolbar({
store: modelStore,
pageSize: 20,
displayInfo: true,
emptyMsg: "No topics to display"
});
Everything is loaded correctly, and the PagingToolbar shows a correct number of pages.PHP Code:var modelStore = new Ext.data.Store({
storeId: 'myStore',
proxy: new Ext.data.HttpProxy({
url: 'models.php'
}),
reader: new Ext.data.JsonReader({
root: 'models',
totalProperty: 'count',
fields: [{name: 'model_id'},
.......
]
}),
remoteSort: false
});
But real data are not paged!!
I see the same whole data every time.
I didn't understand how should server interact with paging.
Could you possibly help me?
Thank you very much.
EMAMake it happen...
-
13 Mar 2008 8:26 AM #5
In addition to the other sources you looked at, you can consider looking at the FAQ in my signature on grids (it's stickied in the forums as well).
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote