[CLOSED] Node visibility

  1. #1

    [CLOSED] Node visibility

    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,
    Last edited by Daniil; Jun 14, 2012 at 2:56 PM. Reason: [CLOSED]
  2. #2
    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.
  3. #3
    Hi,

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

    Thanks Daniiil,
  4. #4
    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);
  5. #5
    Quote Originally Posted by Daniil View Post
    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,
  6. #6
    Do not you want to use this approach?

    Quote Originally Posted by Daniil View Post
    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.
  7. #7
    Quote Originally Posted by Daniil View Post
    Do not you want to use this approach?



    Seems it looks clearer.
    Ok, Tanks Daniil.

Similar Threads

  1. Replies: 0
    Last Post: Aug 09, 2012, 8:30 AM
  2. Replies: 8
    Last Post: Jun 20, 2012, 6:48 PM
  3. Replies: 16
    Last Post: Jul 19, 2011, 3:53 AM
  4. Replies: 1
    Last Post: Nov 24, 2010, 3:04 PM
  5. TreePanel:Copying from one node to another node using drag and drop
    By eighty20 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 25, 2009, 7:48 AM

Tags for this Thread

Posting Permissions