PDA

View Full Version : [ExtJS][GeoExt] Multiple components in one tree node



yo_haha
14 Oct 2012, 12:46 PM
Hi,

I have a tree panel of map layers (nodes of the tree). I'd like to add an opacity slider to each node. So the user will be able to control the layer's opacity through this slider.
I don't know how to put the slider just under the layer's name without being seperated from the node: when I click the node, for example, the layer name and the slider are selected as a one-pack.

Could you help please?

Regards.

yo_haha
15 Oct 2012, 6:11 AM
The slider object is of type :




xtype: "gx_opacityslider", layer: osm, leaf: false, vertical: false, width: 100, plugins: new GeoExt.LayerOpacitySliderTip({template: '<div>Opacity: {opacity}%</div>'})

yo_haha
16 Oct 2012, 3:08 AM
I found an interesting solution:
To manipulate client side interface of tree nodes there is this :


treenode.getUI()

where you can find interesting methods like: getEl() and getAnchor().

And then you can add HTML to the node, for example:


Ext.DomHelper.append(tree.root.firstChild.firstChild.getUI().getAnchor(), '<p>hi</p>');

worthlutz
18 Dec 2012, 10:57 AM
I found an interesting solution:
To manipulate client side interface of tree nodes there is this :


treenode.getUI()



I cannot find this.

Did you figure out how to add a slider to the tree node? I'd like to do the same.

Worth

yo_haha
18 Dec 2012, 11:20 AM
You can find it here : http://docs.sencha.com/ext-js/3-4/#!/api/Ext.tree.TreeNode-method-getUI
I couldn't put the slider on the treenodes because the method



tree.root.firstChild.firstChild.getUI().getAnchor()


returns an undefined object, unfortunately!

If you find something please share with us ;)

worthlutz
18 Dec 2012, 12:22 PM
You can find it here : http://docs.sencha.com/ext-js/3-4/#!/api/Ext.tree.TreeNode-method-getUI
I couldn't put the slider on the treenodes because the method


tree.root.firstChild.firstChild.getUI().getAnchor()

returns an undefined object, unfortunately!

If you find something please share with us ;)

Oh, that's in extJS 3. That's why I could not find it. I'm using architect and extJS 4.

No luck yet.

Anyone else have an idea?

Worth