1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Answers
    6
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Question Answered: Dynamic node loading TreeStore/Panel

    Answered: Dynamic node loading TreeStore/Panel


    I have to implement a Tree, which could possibly have >10.000 nodes. But I can't find examples for this and the API-docs don't address this problem, it seems...

    I want to just load the 1st leven, then, on expanding a 1st-level-node I want to load 10 new nodes etc.

    Do I have to implement this stuff myself with the "on expand" event or does the TreeStore provide this functionality? In the example, just a small .json-file gets loaded, which contains the whole tree, so I don't know if the TreeStore could consume partial data and if yes, how it would be inserted.

  2. I think it is imposible for now. Because tree will be very slow on rendering/displaing.
    Dynamic loading nodes can't solve this issue.
    I have the same prodlem and couldn't solve it yet.
    And yes its posible to load nodes as you said, but... unfortunately it's to slow...
    It's easy to add nodes.
    PHP Code:
        listeners: {
          
    'beforeitemexpand': function(nodeevtObj){
            if (
    node.firstChild.data['col1'].length == 0) {// need to load childs, because no need to download twice
              
    node.removeAll();
              
    Ext.Ajax.request({
                
    url'treeDataJSON.jsp',
                
    params: {
                  
    idnode.data['id']//key id
                
    },
                
    success: function(responseme){
                  var 
    data Ext.decode(response.responseText);
                  if (
    data.success === true) {
                    
    node.appendChild(data.nodes);//add recieved nodes
                  
    }
                }
              });
            }
        }, 
    And for other details:
    http://www.sencha.com/forum/showthre...-slowly-in-IE7

    P.S. Let me know if you solve it i am interested in it too.

  3. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,108
    Answers
    83
    Vote Rating
    31
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    Just return the nodes of the first level in json with leaf is false if there are serverside nodes available. On expand the tree will trigger a load call to the server, and there you deliver the next load of nodes.

  4. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Answers
    6
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    Thank you.

    can I deliver the child nodes with the expanded node as root node?

  5. #4
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,108
    Answers
    83
    Vote Rating
    31
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    No, just return the childnodes. It will send the root node (the node wich you expand) to the server, so you can look up the childnodes in you db.

  6. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    153
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Thumbs up Too much nodes

    Too much nodes


    I think it is imposible for now. Because tree will be very slow on rendering/displaing.
    Dynamic loading nodes can't solve this issue.
    I have the same prodlem and couldn't solve it yet.
    And yes its posible to load nodes as you said, but... unfortunately it's to slow...
    It's easy to add nodes.
    PHP Code:
        listeners: {
          
    'beforeitemexpand': function(nodeevtObj){
            if (
    node.firstChild.data['col1'].length == 0) {// need to load childs, because no need to download twice
              
    node.removeAll();
              
    Ext.Ajax.request({
                
    url'treeDataJSON.jsp',
                
    params: {
                  
    idnode.data['id']//key id
                
    },
                
    success: function(responseme){
                  var 
    data Ext.decode(response.responseText);
                  if (
    data.success === true) {
                    
    node.appendChild(data.nodes);//add recieved nodes
                  
    }
                }
              });
            }
        }, 
    And for other details:
    http://www.sencha.com/forum/showthre...-slowly-in-IE7

    P.S. Let me know if you solve it i am interested in it too.

  7. #6
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Answers
    6
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    so the server would get the expanded node and would answer with the children array like this?
    Code:
    [
      {...},
      {...},
      {...}
    ]
    @Romick:
    We thought about 2 strategies for paging.
    first: just show x nodes per page or just "load" the expanded nodes where just x nodes get expanded at once and you could expand more if you would like to see more.

    the first idea had the problem, what to do in a case like this ( x = 4 ):

    Code:
    --- Page 1 ---
    Root
      A
      B
      C
    --- Page 2 ---
        1
        2
        3
      D
    --- Page 3 ---
      E
      F
        1
        2
    --- Page 4 ---
        3
        4
        5
        6
    But it would keep the size of the rendered tree constant (x).
    The other idea would keep the size smaller than rendering the whole tree, but potentially rather big.

  8. #7
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    153
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Lightbulb treeDataJSON.jsp

    treeDataJSON.jsp


    Here is treedataJSON:

    PHP Code:
    {
    successtrue,
    <%
    int id request.getParameter("id")!=null?Integer.parseInt(request.getParameter("id")):0;
    if (
    row == 0) { %>
    "text":".","children"
      [{
        
    id:'1',
        
    col2:'1 Approval',
        
    iconCls:'task-folder',
        
    colColor:'#F3BCF7',
        
    children:[{}]//if there is sth to expand or leaf: true if not
      
    },{
        
    id:'2',
        
    col2:'2 Supply Chain',
        
    col3:'',
        
    iconCls:'task-folder',
        
    colColor:'#F7F1BC',
        
    children:[{}]
      }]
    <%} else{%>
    nodes:
    [{
                
    id:<%=(id+1)%>,
                
    col2:'some text 1',
                
    col5:'01-Nov-2011',
                
    col6:'15-Dec-2010',
                
    col7:'01-Nov-2010',
                
    col8:'15-Dec-2010',
                
    leaftrue
              
    },
              {
                
    id:<%=(id+2)%>,
                
    col2:'some text 2',
                
    col5:'01-Nov-2011',
                
    col6:'15-Dec-2010',
                
    col7:'01-Nov-2010',
                
    col8:'15-Dec-2010',
                
    children:[{}]
    }]
    <%}%>


  9. #8
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    153
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default Working code

    Working code


    Hi da_b0uncer

    Can you put here your version of code whith 10.000 nodes?
    And if not make threat answered please

  10. #9
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Answers
    6
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    I can't post it, because I'm currently specifying and choosing frameworks for this task. I just wanted to check if Ext JS can do it.

    My questions aren't answered, but I guess no one can answer them, so I will mark the thread as answered.

  11. #10
    Sencha User
    Join Date
    Nov 2012
    Location
    Rossia
    Posts
    1
    Vote Rating
    0
    alisapetrova is on a distinguished road

      0  

    Default Поезда

    Поезда


    Кто ниб знает когда откроют официальный сайт

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar