PDA

View Full Version : form panel paging is loading correct results on page 1 but not on page 2



learner01
28 Aug 2016, 1:44 AM
Hi,
I am using paging with ext.form.panel. I have given pageSize as 4 , total 6 records are there, page 1 loads correct results but page 2 instead of showing only 2 results, displays the correct 2 results and 2 of page 1 also. Please help!!

This is my panel
resultsPanel=Ext.create('Ext.form.Panel', {
id: 'gid',
width: 800,
height:452,
store: store,
renderTo: 'configuration',
autoDestroy: true,
items: items,
dockedItems: [{
xtype: 'pagingtoolbar',
store: store,
dock: 'bottom',
pageSize: 4,
displayInfo: true
}]
});

This is store:
var store = Ext.create('Ext.data.Store', {
model: 'ConfigurationInfo',
remoteSort: false,
//buffered: true,
autoLoad: true,
autoSync: true,
//remoteFilter: true,
pageSize: 4,
proxy: {
type: 'ajax',
url : 'someMethod',
reader: {
type: 'json',
root: 'ct',
totalProperty: 'count',
}
},
listeners:{
load : function(store, records, options){
count=store.getCount();
store.data.each(function(item, index, totalItems ) {
cArr.push(item.data['Name']);
oc.push(item.data['Desc']);
rArr.push(item.data['rLabel']);
ptArr.push(item.data['pDesc']);
sArr.push(item.data['sCode']);
gArr.push(item.data['gId']);
page=item.data['uId'];
});
addItems(count,cArr,oc,rArr,ptArr,sArr,gIdArr,page);
}
}
});
and
addItems() method is adding dynamic items in the panel.

Gary Schlosberg
29 Aug 2016, 10:14 AM
I've never heard of pagingtoolbar being used with a form panel, as it's usually employed with a grid. There's no pageSize config on a form panel -- generally pageSize should be configured on the store. Is your server script configured to respond with pages of form elements?

learner01
29 Aug 2016, 8:23 PM
I've never heard of pagingtoolbar being used with a form panel, as it's usually employed with a grid. There's no pageSize config on a form panel -- generally pageSize should be configured on the store. Is your server script configured to respond with pages of form elements?


Configuring pageSize in store does not work. I am not getting the pagingtoolbar with store.