frew
6 Apr 2009, 1:57 PM
Hello friends,
I am having a crazy issue here. I define a pagingtoolbar on instantiation of a grid and if I give it my grid's store I can no longer close the tab that contains the grid (it seems like it tries to close the store twice or something.) So I thought I'd be clever and instead of giving it the store I give it this.getStore(). Then I can close the tab, but I can no longer use the paging toolbar. Annoying city!
Here is my grid, simplified, but still with the issue:
Ext.ns('ACDRI.ui');
ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, {
generateUrl: function() {
return this.urlBuilder(this.controller, this.action);
},
urlBuilder: ACDRI.fn.generateUrl,
onRender: function(ct, position) {
ACDRI.ui.Grid.superclass.onRender.call(this, ct, position);
this.getStore().load();
},
initComponent: function() {
this.baseParams = this.baseParams || {};
var storeCfg = {
proxy: new Ext.data.HttpProxy({ url: this.generateUrl() }),
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total'
}, this.record),
remoteSort: true,
baseParams: this.baseParams
};
if (this.sortInfo) {
Ext.apply(storeCfg, {sortInfo: this.sortInfo});
}
var store = new Ext.data.Store(storeCfg);
var sm = new Ext.grid.CheckboxSelectionModel();
this.columns = this.columns || [];
this.columns.unshift(sm);
this.tbar = this.tbar || [];
if (this.isPaginated) {
this.bbar = new Ext.PagingToolbar({
pageSize: 25,
//the bug is here apparently
store: store,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No " + this.itemName + " to display"
})
}
var config = {
store: store,
loadMask: true,
sm: sm,
baseParams: this.baseParams
};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments);
}
});
Any ideas?
Thanks!
I am having a crazy issue here. I define a pagingtoolbar on instantiation of a grid and if I give it my grid's store I can no longer close the tab that contains the grid (it seems like it tries to close the store twice or something.) So I thought I'd be clever and instead of giving it the store I give it this.getStore(). Then I can close the tab, but I can no longer use the paging toolbar. Annoying city!
Here is my grid, simplified, but still with the issue:
Ext.ns('ACDRI.ui');
ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, {
generateUrl: function() {
return this.urlBuilder(this.controller, this.action);
},
urlBuilder: ACDRI.fn.generateUrl,
onRender: function(ct, position) {
ACDRI.ui.Grid.superclass.onRender.call(this, ct, position);
this.getStore().load();
},
initComponent: function() {
this.baseParams = this.baseParams || {};
var storeCfg = {
proxy: new Ext.data.HttpProxy({ url: this.generateUrl() }),
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total'
}, this.record),
remoteSort: true,
baseParams: this.baseParams
};
if (this.sortInfo) {
Ext.apply(storeCfg, {sortInfo: this.sortInfo});
}
var store = new Ext.data.Store(storeCfg);
var sm = new Ext.grid.CheckboxSelectionModel();
this.columns = this.columns || [];
this.columns.unshift(sm);
this.tbar = this.tbar || [];
if (this.isPaginated) {
this.bbar = new Ext.PagingToolbar({
pageSize: 25,
//the bug is here apparently
store: store,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No " + this.itemName + " to display"
})
}
var config = {
store: store,
loadMask: true,
sm: sm,
baseParams: this.baseParams
};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments);
}
});
Any ideas?
Thanks!