PDA

View Full Version : Using treestore with directfn



adam.jimenez
8 Apr 2013, 5:41 AM
I'm trying to load a treestore via a directfn but the node just shows a loading spinner regardless of what is returned to the loading function fn:


treeFn = function (file, fn, proxy) {
var nodes = [{
text: 'test',
id: 'test'
}];

fn(JSON.stringify(nodes), {
status: true
});
};


treeFn.directCfg = {
method: {
getArgs: function(params, order, hash){
return [params.path];
}
}
};

tree.getStore().setProxy({
type: 'direct',
directFn: treeFn,
paramOrder: 'id',
reader:{
type:'json'
}
});

evant
8 Apr 2013, 5:44 AM
http://docs.sencha.com/ext-js/4-2/extjs-build/examples/direct/direct-tree.html