We are running ExtJS version 4.1.3
We have an app that uses an Ext.panel.Tree with the store loaded from a remote Xml source. All seemed well during development. But we eventually realized there was a problem when the panel was reloaded a second time. What kept us from realizing there was an issue was that it only happens the second time we reloaded the TreeStore.
On the second call to store.load(), we get the following from Chrome and Safari:
On the surface, it would appear to the same issue reported here:
http://www.mysamplecode.com/2012/03/extjs-4-reload-tree-node-error.html
We have tried both work arounds recommended in this article, but neither had any effect (actually, the replacement for load appears to fail completely under ExtJS 4.1.3 – which I suspect is because it was intended for an earlier edition of 4.1).
A little architecture of our app may be in order. The Tree panel is displayed in a pop-up window. The window uses a ‘card’ layout and the Tree panel is the third card.
We have a controller action that that runs when the event ‘show’ is fired for the third card. It is in that controller action that we make our call to the Tree store load(), that looks like this:
Code:
show: function(abstractcomponent, options) {
var ctrl = this;
var proxy = ctrl.getFolderListStore().getProxy();
proxy.setExtraParam(‘myparam’, ‘param1’);
ctrl. getFolderListStore ().load();
}
Our TreeStore is defined as
Code:
Ext.define('CCPL.store.FolderList', {
extend: 'Ext.data.TreeStore',
requires: [
'CCPL.model.Folder'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: false,
storeId: 'FolderListStore',
model: 'CCPL.model.Folder'
}, cfg)]);
}
});
Our Model is defined as:
Code:
Ext.define('CCPL.model.Folder', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [
{
name: 'id'
},
{
name: 'text'
},
{
convert: function(v, rec) {
if (this.useNull && (v === undefined || v === null || v === '')) {
return null;
}
return v === true || /true/i.test(v) || v == 1;
},
name: 'leaf',
type: 'boolean'
},
{
name: 'checked',
defaultValue: false
}
],
proxy: {
type: 'ajax',
url: '/action/get_folder_list/',
reader: {
type: 'xml',
root: 'folderlist',
record: 'folder'
}
}
});
The Tree panel displays fine on the first time around. We close the window, then re-open the window, and when we invoke the load() call a second time, BAM, the error message get’s tossed.
We’ve also tried running it in Firefox with Firebug, but the error message is much less useful:
"Resuming debugger: error during debugging loop: TypeError: firstViewRangeElement is null"
TypeError: store is null
[Break On This Error]
(164027 out of range 151528) ext-all-dev.js (line 164027
Any help we be greatly appreciated. We are at our wits end with this one!