PDA

View Full Version : Problem with Paging toolbar



maren
11 Aug 2009, 4:12 AM
hi,
I have a problem with paging toolbar,
I can't move to another page with the paging toolbar,this my code if someone have an idea please



Ext.onReady(function(){
Ext.app.REMOTING_API.enableBuffer = 0;
var remotingProvider = Ext.Direct.addProvider( Ext.app.REMOTING_API);
var experienceStore = new Ext.data.DirectStore( {
paramsAsHash:false,
root:'',
directFn: DirectStoreDemo.loadExperienceData,
idProperty:'description',
fields: [
{name: 'id' },

{name: 'value'}
]
});

experienceStore.load({params:{start:0, limit:25}});


var grid = new Ext.grid.GridPanel({
width:700,
height:500,
title:'ExtJS.com - Browse Forums',
store: experienceStore,
trackMouseOver:false,
disableSelection:true,
loadMask: true,

// grid columns
columns:[{
id: 'menu_id',
header: "menu_id",
dataIndex: 'id',
width: 420,

sortable: true
},{
header: "value",
dataIndex: 'value',
width: 70,
align: 'right',
sortable: true
}],

// customize view config
viewConfig: {
forceFit:true,
enableRowBody:true,
showPreview:true

},

// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: experienceStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"

})
});

// render it
grid.render('topic-grid');



});

thanks:)

Condor
11 Aug 2009, 4:18 AM
1. For remote paging your server has to support 'start' and 'limit' parameters.
2. If you also want to enable remote sorting your server needs to process 'sort' and 'dir' parameters.
3. Your server needs to return only the requested records (based on 'start', 'limit', 'sort' and 'dir') and the total number of records (totalProperty needs to be set).

Instead of remote paging you could also try local paging (see my PagingStore user extension).