PDA

View Full Version : use Extend Parameters on Treeloader TreePanel



ffert2907
15 Dec 2009, 12:50 AM
Hiii

I'm using a TreePanel and i want to be able to use extend value parameters from the tree sended by my server.

this is what the sever send, in JSON :


[{text:'TABLEAU DE BORD', expanded:true,children:[{text:'Tableau de bord', id:'PortalTableauDeBord', 'menuvalue':'', 'menuinit':'', leaf:true}
, {text:'Suivi de presence', id:'PanelPresence', 'menuvalue':'', 'menuinit':'', leaf:true}
, {text:'consultation', id:'PanelConsultation', 'menuvalue':'', 'menuinit':'', leaf:true}
, {text:'Grille dynamique', id:'PanelAutoGrid', 'menuvalue':'GASF_MENU', 'menuinit':'app/main_action.php/AUTOGRID/Init/GASF_MENU', leaf:true}
]}, {text:'MON COMPTE', expanded:true,children:[{text:'Mon compte', id:'PanelMonCompte1', 'menuvalue':'', 'menuinit':'', leaf:true}
]


You can see new parameters : menuvalue and menuinit

my problem is that i can't use this value on my panel :


treePanel.on('click', function(n){
var sn = this.selModel.selNode || {}; // selNode is null on initial selection
if(n.leaf && n.id != sn.id){ // ignore clicks on folders and currently selected node
Ext.getCmp('content-panel').layout.setActiveItem(n.id + '-panel');

Ext.MessageBox.alert('VALUE OF MENUVALUE', n.menuvalue);

}
});


I use this to create a menu on left side. The panel change well on the right side...

But the messagebox don't show the menuvalue send by the server...
Why ???
how can i get this value ??? "GASF_MENU"

i need this value to make an extra treatment when the user click on the tree.

thank you for your help.
best Regards
Fabien