PDA

View Full Version : Treepanel, Calling the load every time is expanded.



super.rotus
5 Feb 2014, 11:04 AM
I have a problem in my treepanel,
it is called dynamically, so the elements that can be expanded call the leafs correctly,
The first time the expanded button is click it works, but when I expand it again, it call the ajax again and repaint the same node, why is this hapening? any sugest?
regards

f.baron
5 Feb 2014, 11:47 AM
Hi again! Can you post your current code? If you are using an ajax call to load leaves, why don't you simply add a control like if (node.hasChildNodes())... ?

super.rotus
6 Feb 2014, 11:23 AM
Ext.define('IE.store.seguimiento.packageTracking',{ extend: 'Ext.data.TreeStore',
alias: 'store.PackageTrackingGrid',
storeId: 'PackageTrackingGrid' ,
model:'packageTrackingM',


root: {
text: '',
id: 'packageType',


autoLoad:false,
expanded: false,
children: [
]},
proxy: {
type: 'ajax',
api: {
read: 'packageTracking/findPackages'
},
reader: {
type: 'json'
},

autoload:false ,
autoSync: false


} ,listeners: {
beforeload: function(store, operation, eOpts){
var kode_jabatan = operation.node.get("folioPaquete");
operation.params.packageId = kode_jabatan;

}
}


});

super.rotus
6 Feb 2014, 11:31 AM
The problem is that i'm getting Cannot read property 'internalId' of undefined