frew
7 Apr 2009, 7:11 AM
Hello friends!
So I just switched to the latest and greatest svn checkout of Ext 3 (my version was a week or so old because of the issue I am posting about now) because it fixed some other bug. This issue is probably mine though.
So I have a bunch of grids that inherit from one base grid. I would like to be able to predefine the sorting of the grids and this is how I am doing it:
// in the initComponent of my WorkOrders Grid
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
// in the initComponent of my base grid
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);
The code seems fine to me, but it apparently isn't. When I try to instantiate a grid with the sortInfo defined I get this error:
getBrowser().fastFind.currentWindow is null
load()(Object)ext-all-debug.js (line 18932)
onRender()(Object dom=div#ext-gen41.x-panel-body id=ext-gen41, null)ACDRI.ui.Grid.js (line 36)
render()(Object dom=div#ext-gen41.x-panel-body id=ext-gen41, undefined)ext-all-debug.js (line 24203)
render()()ext-all-debug.js (line 26898)
onLayout()(Object initialConfig=Object xtype=workorder_filter_grid, Object dom=div#ext-gen41.x-panel-body id=ext-gen41)ext-all-debug.js (line 28101)
layout()()ext-all-debug.js (line 27393)
doLayout()(undefined)ext-all-debug.js (line 27172)
doLayout()(undefined)ext-all-debug.js (line 27179)
setActiveItem()(Object initialConfig=Object xtype=workorder_filter_grid)ext-all-debug.js (line 27668)
setActiveTab()(Object initialConfig=Object xtype=workorder_filter_grid)ext-all-debug.js (line 36299)
(?)()([Node workorder_filter_grid] childrenRendered=false rendered=true)ACDRI.ui...cation.js (line 25)
(?)()()ext-all-debug.js (line 2043)
each()([Object scope=Object options=Object, Object scope=Object options=Object 0=Object 1=Object], function(), undefined)ext-base.js (line 170)
fire()()ext-all-debug.js (line 2041)
fireEvent()()ext-all-debug.js (line 1728)
proxyNodeEvent()("click", [Node workorder_filter_grid] childrenRendered=false rendered=true, Object browserEvent=Event mouseout button=0 type=mouseout, undefined, undefined, undefined, undefined)ext-all-debug.js (line 41767)
fireEvent()("click")ext-all-debug.js (line 22787)
fireEvent()()ext-all-debug.js (line 43452)
onClick()(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all-debug.js (line 43536)
onNodeClick()(Object browserEvent=Event mouseout button=0 type=mouseout, [Node workorder_filter_grid] childrenRendered=false rendered=true)ext-all-debug.js (line 42334)
delegateClick()(Object browserEvent=Event mouseout button=0 type=mouseout, span)ext-all-debug.js (line 42317)
h()ext-all-debug.js (line 2386)
chrome://firebug/content/blank.gif options.params[pn["sort"]] = this.sortInfo.field;
ext-all-debug.js (line 18932)
options.params is undefined
chrome://firebug/content/blank.gif options.params[pn["sort"]] = this.sortInfo.field;
Interestingly, this only happens when I try to load the store on render. (by defining the onRender method, not with a listener.)
Any ideas of what I should try instead?
Thanks!
So I just switched to the latest and greatest svn checkout of Ext 3 (my version was a week or so old because of the issue I am posting about now) because it fixed some other bug. This issue is probably mine though.
So I have a bunch of grids that inherit from one base grid. I would like to be able to predefine the sorting of the grids and this is how I am doing it:
// in the initComponent of my WorkOrders Grid
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
// in the initComponent of my base grid
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);
The code seems fine to me, but it apparently isn't. When I try to instantiate a grid with the sortInfo defined I get this error:
getBrowser().fastFind.currentWindow is null
load()(Object)ext-all-debug.js (line 18932)
onRender()(Object dom=div#ext-gen41.x-panel-body id=ext-gen41, null)ACDRI.ui.Grid.js (line 36)
render()(Object dom=div#ext-gen41.x-panel-body id=ext-gen41, undefined)ext-all-debug.js (line 24203)
render()()ext-all-debug.js (line 26898)
onLayout()(Object initialConfig=Object xtype=workorder_filter_grid, Object dom=div#ext-gen41.x-panel-body id=ext-gen41)ext-all-debug.js (line 28101)
layout()()ext-all-debug.js (line 27393)
doLayout()(undefined)ext-all-debug.js (line 27172)
doLayout()(undefined)ext-all-debug.js (line 27179)
setActiveItem()(Object initialConfig=Object xtype=workorder_filter_grid)ext-all-debug.js (line 27668)
setActiveTab()(Object initialConfig=Object xtype=workorder_filter_grid)ext-all-debug.js (line 36299)
(?)()([Node workorder_filter_grid] childrenRendered=false rendered=true)ACDRI.ui...cation.js (line 25)
(?)()()ext-all-debug.js (line 2043)
each()([Object scope=Object options=Object, Object scope=Object options=Object 0=Object 1=Object], function(), undefined)ext-base.js (line 170)
fire()()ext-all-debug.js (line 2041)
fireEvent()()ext-all-debug.js (line 1728)
proxyNodeEvent()("click", [Node workorder_filter_grid] childrenRendered=false rendered=true, Object browserEvent=Event mouseout button=0 type=mouseout, undefined, undefined, undefined, undefined)ext-all-debug.js (line 41767)
fireEvent()("click")ext-all-debug.js (line 22787)
fireEvent()()ext-all-debug.js (line 43452)
onClick()(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all-debug.js (line 43536)
onNodeClick()(Object browserEvent=Event mouseout button=0 type=mouseout, [Node workorder_filter_grid] childrenRendered=false rendered=true)ext-all-debug.js (line 42334)
delegateClick()(Object browserEvent=Event mouseout button=0 type=mouseout, span)ext-all-debug.js (line 42317)
h()ext-all-debug.js (line 2386)
chrome://firebug/content/blank.gif options.params[pn["sort"]] = this.sortInfo.field;
ext-all-debug.js (line 18932)
options.params is undefined
chrome://firebug/content/blank.gif options.params[pn["sort"]] = this.sortInfo.field;
Interestingly, this only happens when I try to load the store on render. (by defining the onRender method, not with a listener.)
Any ideas of what I should try instead?
Thanks!