PDA

View Full Version : ExtJS 4.0.7 Tree Panel not reloading



harman
28 Aug 2014, 4:30 AM
Hi,

I am using an ExtJS 4.0.7 Tree Panel with remote data. I am facing some issues updating (reloading) the tree panel. Am i using wrong way to reload the Tree panel? Following is the sample code

Ext.create('Ext.tree.Panel', {
hidden: true,
rootVisible: false,
id:'myTreePanel',
floating: true,
minHeight: 300,
pickerField: this,
store: new Ext.data.TreeStore({
model: 'MyModel',
clearOnLoad: false,
proxy: {
type: 'ajax',
url : 'some/url?param1=param1&param2=param2',
reader: {
type: 'json',
root: 'children',
successProperty: 'success',
totalProperty : 'totalCount'
},
pageParam: undefined,
startParam: undefined,
pageParam: undefined,
limitParam: undefined
},
load1: function(param1, param2) {
this.proxy.url = 'some/url?param1='+param1+'&param2='+param2;
this.load();
}
})
});

//Model
Ext.define('MyModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'text', type: 'string'},
{name: 'leaf', type: 'boolean'},
{name: 'expanded', type: 'boolean'},
{name: 'children'}
]
});

//JSON


children: [{children:null, leaf:true, expanded:false, id:id1,},{children:null,...},{},{}..]
statusText: ""
success: true



When i use below command it gives the below error allthough it fetches the data but does not updates the Tree structure


Ext.getCmp('myTreePanel').getStore().load1("param1", "param2");



Uncaught TypeError: Cannot read property 'internalId' of undefined

harman
8 Sep 2014, 4:29 AM
http://www.sencha.com/forum/showthread.php?154059-4.0.7-TreePanel-Error-when-reloading-the-treeStore