[CLOSED] NestedList - setting the node's visible-property doesn't affect the visibility.

  1. #1

    [CLOSED] NestedList - setting the node's visible-property doesn't affect the visibility.

    I am trying to hide some nodes from a NestedList, and I want to show it later. But I cannot figure out how. Also, I would like to hide the node during the configuration (C#-code), but I cannot find any Visible or Hidden property for the nodes.

    @{ 
        var x = Html.X();
    }
    @(
        x.NestedList()
            .Store(c=> c.Add(x.TreeStore()
                .Root(x.Node()
                    .Children(
                        x.Node()
                            .Text("Node0")
                        ,
                        x.Node()
                            .Text("Node1")
                    )
                )
            ))
            .Listeners(l=>l.Initialize.Handler= @"            
                // Putting Node0 into a record-variable:
                var record = item.getStore().getRoot().childNodes[0];
                            
                // Logging the visible-property on the console shows that visible=true;
                console.log('Node0 visible:', record.get('visible'));
                
                // Setting visible to false:
                record.set('visible', false);
    
                // Logging shows that the the visible-property is now false:
                console.log('Node0 visible:', record.get('visible'));
                
                // Right now the first node in the list should be hidden, but it is still visible.
                // Is there some refresh-method that should be called here?
            ")
    )
    Last edited by Daniil; Sep 12, 2016 at 12:17 PM. Reason: [CLOSED]
  2. #2
    Hello!

    It does not seem the NestedList supports hiding specific entries at all, although the property is inherited by the Ext.data.Model object.

    But here's something that "works" and may be worked upon the best way to hide the node:

        <script type="text/javascript">
            Ext.defer(function () { App.NestedList1.getAt(0).getAt(0).innerItems[0].hide(); }, 2000);
        </script>
    I might spend a little more time on this because it seems unavailable on the events I tried so far on the nested list, and also if I just run it on Ext.onReady(). But might be useful to hide on-the-run. Notice I added a .ID("NestedList1") to the component in order to be able to do this.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Labels not visible in Ext Node of TreePanel
    By fourier in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 07, 2012, 12:08 AM
  2. Replies: 1
    Last Post: Aug 23, 2011, 7:09 PM
  3. Setting node icons with TreeLoader(s)
    By thedarklord in forum 1.x Help
    Replies: 3
    Last Post: Aug 17, 2010, 11:49 PM
  4. Replies: 5
    Last Post: Sep 14, 2008, 12:56 PM
  5. Replies: 4
    Last Post: Sep 10, 2008, 4:17 AM

Posting Permissions