PDA

View Full Version : Pager does not work



Valik71
4 Jun 2013, 4:06 AM
I'm using 4.0.7. When you add a pager still shows all the records. Here is my code

var Grid_ostatok = Ext.create('Ext.grid.Panel',{
store: Store_ostatok,
height: 470,
columns:[{
text:'??????????',dataIndex:'name',
flex:1
},{
text:'??????',dataIndex:'dohod',
renderer:formatCurrency, align:'right',editor:{maskRe: /[\d\\.]/}
},{
text:'??????',dataIndex:'rashod',
renderer:formatCurrency, align:'right',editor:{maskRe: /[\d\\.]/}
}],
plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})],

dockedItems: [{
xtype: 'pagingtoolbar',
store: Store_ostatok, // same store GridPanel is using
dock: 'bottom',
emptyMsg: "??? ???????",
displayMsg: '???????? {0} - {1} ?? {2}',
displayInfo: true
}]
});

and store

var Store_ostatok = Ext.create('Ext.data.Store',{
proxy: {
enablePaging: true,
type: 'ajax',
url: 'inc/ajax/ostatok.php?get=2'
},
fields:[
{name:'id',type:'int'},
{name:'name',type:'string'},
{name:'edrpou',type:'int'},
{name:'dohod',type:'float'},
{name:'rashod',type:'float'}
],
//autoLoad: {start: 0, limit: 50},
autoLoad: {params: {start: 0, limit: 50}},
pageSize: 50,
/*listeners: {
'beforeload': function(){
var fv_array = clients_get_filters();
Store_ostatok.getProxy().extraParams = {
filter_param_name: fv_array['name'],
filter_param_kod: fv_array['kod']
};
}
}*/
});
I try and so and so - loaded all the records, but the pages are in the pager

friend
4 Jun 2013, 8:56 AM
The server-side is responsible for returning the requested page of data, as specified by the start and limit parameters.

Valik71
4 Jun 2013, 9:52 AM
Thanks. I've already got it. On the server, make the necessary inquiries.