json - Extjs4: Cannot display all Tree Nodes -> TypeError: records[i] is undefined -


i error: typeerror: records[i] undefined

i json database. array, encode json looks this:

array( ['data'] => array(  [0] =>     array(  ['id'] =>     1 ['text'] =>     'country1' ['leaf'] =>     ['children'] =>     array(  [0] =>     array(  ['id'] =>     'hf' ['text'] =>     'hf' ['leaf'] => ) [1] =>     array(  ['id'] =>     'tf' ['text'] =>     'tf' ['leaf'] => ) [2] =>     array(  ['id'] =>     'sf' ['text'] =>     'sf' ['leaf'] => ) ) ) [1] =>     array(  ['id'] =>     2 ['text'] =>     'country2' ['leaf'] =>     ['children'] =>     array(  [0] =>     array(  ['id'] =>     'hf' ['text'] =>     'hf' ['leaf'] => ) [1] =>     array(  ['id'] =>     'tf' ['text'] =>     'tf' ['leaf'] => ) [2] =>     array(  ['id'] =>     'sf' ['text'] =>     'sf' ['leaf'] => ) [3] =>     array(  ['id'] =>     'sp' ['text'] =>     'sp' ['leaf'] => ) ) ) 

my store looks this:

ext.define('am.store.trees', { extend: 'ext.data.treestore', model: "tree", autoload: true, proxy: {     type: 'ajax',     url : 'data/ajax.tree.php',     extraparams:{         action:'gettree'     },     actionmethods: {         create : 'post',         read   : 'post',         update : 'post',         destroy: 'post'     },     reader: {         type: 'json',         root: 'data'     } } }); 

i can open first node "country1". subparty shown. when click on next node, error appears.

why error? can me please?

the problem same leaf (with same id) shows in multiple branches. extjs tree not handle that. either don't bring id or customize ids unique in entire tree.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -