PDA

View Full Version : tree panel configure nodes with JSON



nadeemshafi9
17 Jun 2009, 5:39 AM
hi guys

i am configuring my treepanel with json from a url and it works fine, i am finding it very hard to pass a listeners config object throgh my json into my tree panel here is my JSON



........\/logout"}]},{"text":"Reports","children":[{"text":"Reports"
,"id":"treport","leaf":"true","listeners":"{ 'click' : { fn: function(){ alert('hello'); },scope: this
,delay: 100}"}]},{"text":"Call Logs",.......


thanks

19 Jun 2009, 8:02 PM
after the nodes load, you can process them and attach the listener directly.

nadeemshafi9
19 Jun 2009, 8:19 PM
thanks j, thats what i did in teh end, apparently if you look at the tree panel node API it says you can attach a listener, on teh server i use an array that is auto formatted into json.

so i gota guess

$blah['listeners']['click'][fn] = "blah";

echo $blah->toJson();
......

initial config = get json

i used firebug to look at the composition of the treepanel and i see that the click event gets inserted but as JSON lol - just was taking too long .