PDA

View Full Version : Ext.PagingToolbar not paging



nadeemshafi9
28 May 2009, 6:58 AM
Hi guys

I am using the Ext.PagingToolbar, its not paging, i am using it in conjunction with saki's drag drop grids which i have placed inside two panels one each.

I know the json total meta is correct in firebug.

I know my store has the total because i can see it throgh firebug.

I have set the totals property in the json store i am using for its reader using the jsonstore all in one class

anything else ?


saki's bit moded



// hard coded config - cannot be changed from outside
var config = {
store:new Ext.data.JsonStore({
totalProperty: 'totalCount',
id: 'id',
url: '/irhtv/index/getmoviesforpackaging',
root: 'items',
autoLoad: true,
baseParams: {
package_id: m[0].data.id
},
fields: ['id', 'movie_type', 'order', 'name', 'source_type', 'url', 'desc',
'img', 'price', 'year', 'actors', 'director', 'trailer_url', 'synopsis']
})
};

// apply config
Ext.apply(this, Ext.apply(this.initialConfig, config));

// call parent
Example.Grid1.superclass.initComponent.apply(this, arguments);

} // eo function initComponent
}); // eo extend

// register xtype
Ext.reg('examplegrid1', Example.Grid1);
// }}}
// {{{
Example.Grid2 = Ext.extend(Example.Grid, {
initComponent:function() {
// hard coded config - cannot be changed from outside
var config = {
store:new Ext.data.JsonStore({
url: '/irhtv/index/getpackagemovies',
root: 'items',
totalProperty: 'totalCount',
autoLoad: true,
baseParams: {
package_id: m[0].data.id
},
id: 'ddgrid2store',
fields: ['id', 'movie_type', 'order', 'name', 'source_type', 'url', 'desc',
'img', 'price', 'year', 'actors', 'director', 'trailer_url', 'synopsis']
})
};

// apply
my bits


items: [{
xtype:'panel',
bbar: new Ext.PagingToolbar({
id: 'panel1bbar',
pageSize: 5,
displayInfo: 'Lines {0} - {1} of {2}',
emptyMsg: 'No Lines to display',
/*
DUMMY STORE (this is the store of the main extphp page grid it is
used as a dummy and replaced before window show)
*/
store: store
}),
title: 'Available Movies',
items: [{
xtype: 'toolbar',
id: 'panel1tbar'
},{
xtype:'examplegrid1',
id: 'grid1',
height: 200,
}]
},{
xtype:'panel',
title: 'Movies In This Package (Save changes after midification)',
items: [{
xtype: 'toolbar',
items: [{
}]
},{
xtype:'examplegrid2',
id: 'grid2',
height: 200
}]
}]
}

......


Ext.getCmp('panel1bbar').store = Ext.getCmp('grid1').getStore();

updateMovieWindow.show();



thanks !!!

28 May 2009, 5:44 PM
look at the paging example in the SDK. you'll see that you need to load the manually once, and set autoLoad to false.

nadeemshafi9
28 May 2009, 5:47 PM
i figured it out eventualy, what was hapening was that i used that dummy store wich kinda conected it for good, i figured this as the total in my grid was good but the reload of the 3rd base grid on another area made this one relaodd, now i externaly insert the toolbar after the definition of the above window by extracting the store from the grid.

tnx