[Users] Radio Button in Sub-nodes (Treeview)...

Andreas Hocevar ahocevar at opengeo.org
Wed Oct 7 09:09:27 CEST 2009


Paul james wrote:
> About my other problem (Change sublayer label on treeview) ...
> I tried with that :
>  
> tree.on('beforeappend', function(tree, parent, node){
>   node.text = "test";
>  });
>  
> It only changes the last child... Can you help me on that?

I think so. Because the visual representation of the layer order is the
other way around as the layer stack, nodes are inserted rather than
appended. Try the following:

function setText(tree, parent, node) {
    node.text = "test";
}
tree.on({
    beforeappend: setText,
    beforeinsert: setText
});

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list