1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    14
    Vote Rating
    0
    dadaking is on a distinguished road

      0  

    Default Unanswered: Tree empty folder show root node

    Unanswered: Tree empty folder show root node


    Hello,

    I try to show in a Tree panel a Files System.
    I feed my tree with json data and it's work perfectly!

    But when I have an empty folder, the tree folder (when it's deploy) show me the complete tree again.
    In my server I send a json file which doesn't have children properties.

    Anybody has an idea for help me?

    Thanks!

    David

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,912
    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


    Does it help to call tree.removeAll()?

    Scott.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    14
    Vote Rating
    0
    dadaking is on a distinguished road

      0  

    Default


    Thanks for your answer.

    But I don't know how use it. There is my code for the tree:

    Code:
    Ext.onReady(function () {
            var treeStore = Ext.create('Ext.data.TreeStore', {
                proxy: {
                    type: 'ajax',
                    url: '/File/Tree'
                },
                root: {
                    text: 'Files root',
                    id: 'root',
                    expanded: true
                }
            });
            var treeUp = Ext.create('Ext.tree.Panel', {
                id: 'TreeFileSystem',
                title: 'TEST',
                useArrows: true,
                store: treeStore,
                rootVisible: false,
                renderTo: 'Tree',
                height: 350,
                listeners: {
                    itemClick: function (view, record) {
                    }
                }
            });
        });
    and there is an example of my json code

    Code:
    [
    	{"cls":"first-level","expanded":"false","children":[
    		{"cls":"first-level","expanded":"false","children":[
    			{"leaf":"true","text":"..."},
    			{"leaf":"true","text":"..."}
    			],"text":"..."}
    		],"text":"..."},
    	{"text":"..."}
    ]
    When I look the console of firebug, I can see, when I open the empty folder, the tree call again the store withouth attribute.console.JPG
    And there is a screenshot of the tree.
    tree.JPG

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    14
    Vote Rating
    0
    dadaking is on a distinguished road

      0  

    Default


    Nobody have an idea?

    EDIT: I found the solution, I build my JSON with this achitecture :

    Code:
    {"path":"...","cls":"first-level","expanded":"false","children":[],"text":"..."}
    The cls and children:[] solve the problem.
    Last edited by dadaking; 19 Sep 2012 at 5:34 AM. Reason: I found solution

Thread Participants: 1

Tags for this Thread

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..." hd porno faketaxi