Results 1 to 2 of 2

Thread: appendChild doesn't work in TreePanel

  1. #1
    Sencha User
    Join Date
    Jan 2014
    Location
    Mumbai, India
    Posts
    9

    Default appendChild doesn't work in TreePanel

    I am creating a plugin for JSON viewer, wherein I have tab panels one for feeding text i.e JSON and another tab for viewing the JSON in tree format.

    I am using EXTJS - 5.1.0

    Initially when I view the JSON, it displays the tree perfectly. Now when I have to view different JSON, I have to first remove all the childs in tree and have to append the new set of nodes. The removal of child nodes removes all child, but when I try to appendChild the tree in not formed, however when I console the object on Chrome console. I can see all of my object... but the tree is not formed.

    Here is my code snippet

    Code:
    treebuild: function () {
                    while(tree.getStore().getRoot().hasChildNodes()){
                        tree.getStore().getRoot().removeChild(tree.getStore().getRoot().getChildAt(0));
                    }
                    
                    var appendChildArr = this.json2leaf(json);
                    for(i in appendChildArr){
                        tree.getStore().getRoot().appendChild(appendChildArr[i]);
                    }
                    tree.getStore().getRoot().set('iconCls', (Ext.isArray(json) ? 'icon-json-array' : 'icon-json-object'));
                    this.gridbuild(tree.getStore().getRoot());
                },
    Kindly tell where I am going wrong.

    Thanks in advance.

    Manish Sharma

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    I don't see the issue when looking at your code. Are you able to recreate this behavior in a test case?
    https://fiddle.sencha.com/#home

Similar Threads

  1. [NOREPRO] appendChild(Node) doesn't work correct in Ext 4.1
    By jonas007 in forum Ext:Bugs
    Replies: 4
    Last Post: 23 Jul 2013, 4:19 AM
  2. Stateful Treepanel Plugin doesn't work, help!!!
    By houxiaofei in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 20 Feb 2013, 1:51 PM
  3. Replacing treepanel doesn't work
    By jimraynor0 in forum Ext: Discussion
    Replies: 0
    Last Post: 20 Jun 2011, 10:39 PM
  4. TreePanel doesn't work in IE 8
    By kalan in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 15 Mar 2011, 6:24 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •