tags:

views:

470

answers:

2

I have managed to write a function that focusses a given node. Now I want to call it after tree creation. Since I construct the tree with php an send it via AJAX, I want to send the node to focus with the tree. Therefore I found this solution:

<script type="dojo/connect" event="postCreate">focusTreeNode("'.$this->focusitem . '");</script>

This doesnt fire the event. But if I use dojo/method instead, it gets fired but the tree is no longer drawn. I found out that dojo/method replaces the hook and dojo/connect hooks into the chain. I am really confused now and help would be very appreciated since I am stuck in a project with high time pressure.

Thanks! Micha

+1  A: 

I suspect your postCreate() code is firing but it's happening before your TreeNode's are created.

If you can upgrade to Dojo 1.4 then there's an onLoad event that you can connect to.

Bill Keese
A: 

Thanks, i will give 1.4 a try! It seems that it also supports lazy loading for the tree much better, there I also ran into some performance problems...