GIGJ.COM
welcome to my space
X
Search:  
Welcome to:gigj.com
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
NAVIGATION: Home >>

TreePanel and JSON TreeLoader Problem (new nodes invisible)

Published by: wktd 2009-01-07
  • TreeLoader and custom node value sent to server - Ext JS Forums::
    3 posts - Last post: Feb 16, 2007So, I thought about modifying the TreeLoader class. . TreePanel and JSON TreeLoader Problem (new nodes invisible), sjanes71, Ext: Help
    http://extjs.com/forum/showthread.php?t=2295
    HOME
    Hello YUI-EXT hackers!

    I have a TreePanel that is dynamically loading its data from a JSON query and while it loads the data fine, it insists on making the nodes invisible. Is there something obvious I'm missing to how TreePanel's render newly imported nodes? The first level of nodes load and are visible, subsequent levels are not.


    var tree__eF9sYWJlbF90b3BpY3M = function(){
    var Tree = Ext.tree;
    return {
    init: function(){
    var tree = new Tree.TreePanel('tree__eF9sYWJlbF90b3BpY3M', {
    animate:true,
    loader: new Tree.TreeLoader({dataUrl: '/label/navigate_json'}),
    });
    var root = new Tree.AsyncTreeNode({
    text: 'Topics',
    draggable:false, // disable root node dragging
    id:'topics::'
    });
    Meta Thought: Oh ExtJS TreePanel Click, wherefore art thou?::
    Aug 21, 2008 tree = new Ext.tree.TreePanel({ loader: new Ext.tree.TreeLoader({ Expand invisible root node to trigger load of the first level of
    http://charlmatthee.blogspot.com/2008/08/oh-extjs-treepanel-click-wherefore-art.html
    HOME
    new Tree.TreeSorter(tree, {folderSort:true});
    tree.setRootNode(root);

    tree.render();
    root.expand(false, /*no anim*/ false);
    }
    };
    }();
    Ext.EventManager.onDocumentReady(tree__eF9sYWJlbF9 0b3BpY3M.init, tree__eF9sYWJlbF90b3BpY3M, true);



    My JSON data looks like:


    [
    {"text":"Animation","id":"topics::Arts/Animation","cls":"folder"},
    {"text":"Architecture","id":"topics::Arts/Architecture","cls":"folder"},
    /* ... the rest elided ... */
    ]


    And I think that I'm including the correct CSS because it does show the folder icons and tree lines connecting the nodes.

    Thanks in advance for any ideas!

    --Simon


  • ok I got back home copied and paste your code in a test file and tried your code out.
    TreeLoader JSON schema, rendering, sorting - Ext JS Forums::
    TreePanel and JSON TreeLoader Problem (new nodes invisible), sjanes71, Ext: Help , 32, 05-11-2007 10:55 AM. Extending a JSON schema, gordon, Ext: Help
    http://yui-ext.com/forum/showthread.php?t=1447
    HOME
    TreePanel and JSON TreeLoader Problem (new nodes invisible) - Page ::
    Page 3-TreePanel and JSON TreeLoader Problem (new nodes invisible) Ext: Help. TreePane dynamically loads in nodes from a JSON TreeLoader.
    http://www.extjs.net/forum/showthread.php?t=3512&page=3
    HOME

    I removed the extra comma after your loader declaration and here's what I got:

    http://i3.tinypic.com/2r6z29u.png

    here's the html file:























  • I have my reaons for the crazy variable name. :)
    TreePanel and JSON TreeLoader Problem (new nodes invisible) - Page ::
    10 posts - Last post: Mar 21, 2007Page 3-TreePanel and JSON TreeLoader Problem (new nodes invisible) Ext: Help. the expanded nodes are invisible from the first expand.
    http://extjs.com/forum/showthread.php?t=3512&page=3
    HOME
    tg-extjs-sample: changeset 1:f49cb72f2260::
    + <li>Ability to specify dataUrl or a TreeLoader config in addition to a TreeLoader instance</li>. + <li>New nodeTypes support for more flexible node
    http://freehg.org/u/jorgevargas/tg-extjs-sample/rev/f49cb72f2260
    HOME

    Apologies if this blows out the forum formatting, images changed to PNG's so they are more legible.
    Before:
    http://www.recursism.com/images/tree-sample.png

    After:
    http://www.recursism.com/images/tree-sample-after.png


  • Here is the rendered HTML source of the Topics tree that isn't rendering the sublevels, this has been formatted a little bit so its easier to read:









    • http://www.yui-ext.com/s.gif
      http://www.yui-ext.com/s.gif


      Topics



    • After this line:


      loader: new Tree.TreeLoader({dataUrl: '/label/navigate_json'}),


      You have an errant comma. Get rid of the comma and try again.


    • Bernard, I meant your reply. I see simon posted his capture, as you asked. Why does the open branch simply not render? (I had that happen to me too, but accidently trashed my sample.)


    • Eager to see some replies


    • May I see the response as well? I might sound a bit annoying here but thats how I debug when I don't see obvious errors in the code. :) and if you use the inspect function on the TreePanel, do you see those LI html tags?


    • that's one hell of a variable name Simon : tree__eF9sYWJlbF90b3BpY3M! :lol:

      seriously I don't see any obvious errors here. can you post a screenshot with firebug's console open or a link?





    • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
      Busy Friday Leads to Strong Close for Net Stocks
  • PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about TreePanel and JSON TreeLoader Problem (new nodes invisible) , Please add it free.
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 gigj.com        Site made:CFZ