PDA

View Full Version : [CLOSED] Node visibility



softmachine2011
Jun 13, 2012, 11:33 AM
Hi,

How can hide "NODO2"?



<ext:Node Text="NODO1" Icon="Box" Expanded="true">
<Children>
<ext:Node Text="NODO2" Icon="Brick"></ext:Node>
</Children>
</ext:Node>


I need javascript and Databind solution, please.

Thanks,

Daniil
Jun 13, 2012, 1:43 PM
Hi,

I am not sure it will work in all cases, but please try the following.

1. Hide initially by setting up

Cls="x-hidden"

2. To show/hide on the fly via JavaScript.

var record = App.TreePanel1.getStore().getNodeById('Node1');
node = App.TreePanel1.view.getNode(record);

Ext.fly(node).down("td").removeCls("x-hidden"); //show
Ext.fly(node).down("td").addCls("x-hidden"); //hide

I also would consider a possibility to add/remove nodes instead of hide/show.

softmachine2011
Jun 13, 2012, 1:53 PM
Hi,

Ext.NET 1.x exists "hidden" property. Could be recovered?

Thanks Daniiil,

Daniil
Jun 13, 2012, 6:51 PM
Unfortunately, no. At least, now. Please see the related discussion on Sencha:
http://www.sencha.com/forum/showthread.php?142704

You could try this:

<ext:Node Text="Node1 (level 3)" Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="hidden" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>

Though we are not sure it will work well in all cases.

To hide/show on the fly you could use:

App.TreePanel1.getStore().getNodeById("nodeId").set("hidden", true/false);

softmachine2011
Jun 14, 2012, 10:29 AM
Unfortunately, no. At least, now. Please see the related discussion on Sencha:
http://www.sencha.com/forum/showthread.php?142704

You could try this:

<ext:Node Text="Node1 (level 3)" Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="hidden" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>

Though we are not sure it will work well in all cases.

To hide/show on the fly you could use:

App.TreePanel1.getStore().getNodeById("nodeId").set("hidden", true/false);

Hi,

For the problem of DataBind, I opted for the following:



<ext:Node Text="NODO1" Icon="Box" Expanded="true">
<Children>
<ext:Node Text="NODO2" Cls'<%# Manager.IsVisible() ? "" : "x-hidden" %>' Leaf='<%# !Manager.IsVisible() %>'></ext:Node>
</Children>
</ext:Node>


Daniiil, if you see that the solution is correct, you can close the thread.

Thanks,

Daniil
Jun 14, 2012, 11:32 AM
Do not you want to use this approach?



You could try this:

<ext:Node Text="Node1 (level 3)" Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="hidden" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>


Seems it looks clearer.

softmachine2011
Jun 14, 2012, 2:54 PM
Do not you want to use this approach?



Seems it looks clearer.

Ok, Tanks Daniil.