1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    india
    Posts
    52
    Vote Rating
    0
    amitkumarchauhan is on a distinguished road

      0  

    Default Unanswered: stop lazy loading on ext tree panel & store

    Unanswered: stop lazy loading on ext tree panel & store


    I am using ext tree panel & ext tree store to render tree grid; i am providing json for all parents & respective children which can go till any level.Now when i expand any of the parent ...store fires request to load child data but i want to stop such lazy loading since my first load request itself is fetching complete data in hierarchy; how can i do that?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Answers
    655
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    How are you defining your tree? If you return the entire structure it should work as expected.

    See TreePanel example:
    http://docs.sencha.com/ext-js/4-0/#!/api/Ext.tree.Panel

    Regards,
    Scott.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    Santa Clara, California
    Posts
    9
    Vote Rating
    0
    nikolai.efimov is on a distinguished road

      0  

    Default


    I'm having the same problem. I return the full json with all the leafs on the first request.

    Tree config:

    Code:
    {
            xtype: 'treepanel',
            store: Ext.create('Ext.data.TreeStore', {
                proxy: {
                    type: 'ajax',
                    url : 'app/php/getClusterTree.php',
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                }
            }),
            rootVisible: false
        }
    JSON return from the server:

    Code:
    {
       "success": "true",
        "data": [{
            "text": "ThisIsCluster1",
            "children": [{
                "children": [{
                    "text": "192.168.0.209",
                    "server_id": 1,
                    "leaf": "true"
                },
                {
                    "text": "192.168.0.208",
                    "server_id": 2,
                    "leaf": "true"
                }],
                "text": "Servers"
            },
            {
                "children": [{
                    "text": "root",
                    "user_id": 1,
                    "leaf": "true"
                }],
                "text": "Users"
            }]
        },
        ... here two more entries ...
        ]
    }
    Screen shot:

    tree.gif

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    France
    Posts
    4
    Vote Rating
    6
    eternoendless is on a distinguished road

      0  

    Default


    I had the same problem, this other thread helped me to resolve it:

    http://www.sencha.com/forum/showthre...json-root-node

    (look at post #5)

    It seems that the object containing the tree within a JSON response needs to be called exactly the same as the 'children' property name. The only way of having it with a different name is by overriding getResponseData() in the reader so as to return the content of the tree within the response JSON.

    In short, here's solution #1: (changing the object name from "data" to "children")
    Code:
    {
       "success": "true",
        "children": [{
            "text": "ThisIsCluster1",
            "children": [{
                "children": [{
                    "text": "192.168.0.209",
                    "server_id": 1,
                    "leaf": "true"
                },
                {
                    "text": "192.168.0.208",
                    "server_id": 2,
                    "leaf": "true"
                }],
                "text": "Servers"
            },
            {
                "children": [{
                    "text": "root",
                    "user_id": 1,
                    "leaf": "true"
                }],
                "text": "Users"
            }]
        },
        ... here two more entries ...
        ]
    }
    solution #2: (overriding getResponseData() in the reader)
    Code:
    store: {
        ...
        reader: {
            type: 'json',
            getResponseData: function(response) {
                var jsonData = Ext.JSON.decode(response.responseText,true);
                return jsonData.data;
            }
        }
    }

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."