[OPEN] [#207] How to add a node with children

  1. #1

    [OPEN] [#207] How to add a node with children

    This worked in 1.x. I want to add a node with children to a tree. The new node contains 1 child but when added, it shows two children with the same id. What am I doing wrong?

    <html>
    <head>
    </head>
    <body>
        <script type="text/javascript">
            function addStuff() {
                TreePanel1.getRootNode().appendChild([{
                    id: 'item1',
                    text: 'item1',
                    expanded: true,
                    children: [{
                        id: 'item1A',
                        text: 'item1A',
                        children: [],
                        leaf: true
                    }]
                }]);
            }
        </script>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" Theme="Gray"
            DisableViewState="true" Namespace="" />
        <ext:TreePanel ID="TreePanel1" runat="server" Width="300" Height="450" Icon="BookOpen"
            Title="Catalog" AutoScroll="true">
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Add Stuff" Handler="addStuff();">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <Root>
                <ext:Node Text="Composers" Expanded="true">
                    <Children>
                        <ext:Node Text="Beethoven" Icon="UserGray">
                            <Children>
                                <ext:Node Text="Concertos">
                                    <Children>
                                        <ext:Node Text="No. 1 - C" Icon="Music" Leaf="true" />
                                        <ext:Node Text="No. 2 - B-Flat Major" Icon="Music" Leaf="true" />
                                        <ext:Node Text="No. 3 - C Minor" Icon="Music" Leaf="true" />
                                    </Children>
                                </ext:Node>
                            </Children>
                        </ext:Node>
                    </Children>
                </ext:Node>
            </Root>
        </ext:TreePanel>
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 15, 2013 at 3:21 PM. Reason: [OPEN] [#207]
  2. #2
    Last edited by jchau; Apr 13, 2013 at 4:55 AM.
  3. #3
    Hi @jchau,

    Seems, @JTRipper suggests something in the "Possible fix" section. Have you tried it?
  4. #4
    Yes, the possible fix worked
  5. #5
    Thank you for confirming.

    We decided to commit that change as a temp fix. Though, still need to monitor the Sencha thread and wait their fix.

    Created an Issue to monitor.
    https://github.com/extnet/Ext.NET/issues/207

Similar Threads

  1. [CLOSED] Get Children Nodes of TreePanel
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 04, 2012, 10:00 AM
  2. [CLOSED] Remove moving a node VS loading targetĀ“s children.
    By RCN in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 14, 2012, 5:11 PM
  3. communication between children
    By threewonders in forum 1.x Help
    Replies: 5
    Last Post: Apr 11, 2012, 11:52 AM
  4. Replies: 16
    Last Post: Jul 19, 2011, 3:53 AM
  5. Replies: 1
    Last Post: Nov 17, 2010, 12:42 PM

Posting Permissions