PDA

View Full Version : JsonPagingStore question



shoarh
22 Mar 2010, 1:11 AM
Hi ,all
It's simple question, I want to use JsonPagingStore for paging my data,
the code like below ,
but I don't know which type of data the server return , through the second paramter url

I use the data type in data.php like [ {taskid:'1',title:'test1' },{taskid:'2',title:'test2' }]
but it does not work ...
can any body give me an example ,thanks ...

Example of a remote store:
var store = new Ext.ux.data.PagingSimpleStore({ fields: [...], url: 'data.php', autoLoad: {params: {start: 0, limit: 10}}});

Zdeno
22 Mar 2010, 1:24 AM
http://defafe.com/simple-paging-grid-extjs/
http://www.extjs.com/learn/Tutorial:Using_Ext_grid_form_dialog_to_achieve_paging_list,_create,_edit,_delete_function

Condor
22 Mar 2010, 1:34 AM
First make up you mind if you want to use remote or local paging.

With remote paging you should be using a normal Store and not a PagingStore and your server should return the correct records based on the start and limit parameters.

With local paging your server should simply return all records.

shoarh
22 Mar 2010, 1:44 AM
First make up you mind if you want to use remote or local paging.

With remote paging you should be using a normal Store and not a PagingStore and your server should return the correct records based on the start and limit parameters.

With local paging your server should simply return all records.

Is it if I want to use the remote paging (that is to get the data throught a url with a jsp page) does not support the PagingStore ? what I could use is only a normal Store ?

Condor
22 Mar 2010, 2:23 AM
Is it if I want to use the remote paging (that is to get the data throught a url with a jsp page) does not support the PagingStore ? what I could use is only a normal Store ?

No, the question is:
Do you want to have the server return the data in pages or do you want the server to return all data and have the client display it in pages?

The first one is remote paging. You don't need a PagingStore for that, but you will need to modify how your server returns data.

The second one is local paging. In this case you do need a PagingStore (don't use it for large amount of records!).

shoarh
22 Mar 2010, 2:56 AM
No, the question is:
Do you want to have the server return the data in pages or do you want the server to return all data and have the client display it in pages?

The first one is remote paging. You don't need a PagingStore for that, but you will need to modify how your server returns data.

The second one is local paging. In this case you do need a PagingStore (don't use it for large amount of records!).

Thanks Condor,
I think I should use the second one ,local paging ..
I saw the file PagingStore.js there are two kind of store in it ,
another question is what is the difference between SimplePagingStore and JsonPagingStore ,
which kind of store I should use ,:)

Condor
22 Mar 2010, 3:22 AM
It depends on your JSON data (see the API docs for the difference between SimpleStore and JsonStore).