PDA

View Full Version : Tree Picker Implementation using ExtJS 4.0



harman
25 Aug 2014, 7:49 AM
Hi All,

I am using ExtJS 4.0.7 Picker field which contains a tree panel.
The Tree panel is loaded with remote data. This data gets updated in the back-end every now and then so i want to fetch the tree panel data every time someone clicks the trigger on the UI.
The problem is that the createPicker function runs only once. I can call the createPicker function from the expand event of the picker which will reload its store but it isnt removing the old tree and i still cant see new tree structure.

Sample Code:


{
xtype: 'pickerfield',
editable:false,
createPicker: function() {
return Ext.create('Ext.tree.Panel', {
hidden: true,
rootVisible: false,
floating: true,
minHeight: 300,
pickerField: this,
store: new Ext.data.TreeStore({
model: 'myModel',
proxy: {
type: 'ajax',
url : 'some/url',
reader: {
type: 'json',
root: 'children',
successProperty: 'success',
totalProperty : 'totalCount'
}
}
}),
listeners:{
select: function(view, record, item, index, event) {
//set value of picker and collapse the picker
}
}
});
}
}


I am able to make a call to server for data reload using

PickerObj.createPicker();
But the view of the panel shown in picker still doesnt reflect the new data.

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