1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    -1
    lambidu is an unknown quantity at this point

      0  

    Default Unanswered: Problems with Tree Store and Tree Panel

    Unanswered: Problems with Tree Store and Tree Panel


    Hi,

    As I have written in the title I have a problem with Tree Store and Tree Panel
    I'm trying to create a File Browser for my website ...

    I connect to the server ...
    The server returns JSON data ...
    And everything seems to work fine ...
    2012-11-05_1433.png
    "

    In the Tree Panel "displayField" property does not work ... (I set the field "name" - and the text disappeared)

    In Tree Store "autoLoad" property does not work ... (I set the "false" - but the data is all the same load automatically ...)

    In my application I need to do on the left (west region) - Tree Panel with folders on the server and on the right (center region) - to show contents of the selected folder in the Tree Panel

    Filtering does not work ... no "initComponent", no "afterRender" ...
    I have tried function "filterBy" and "filters" but nothing happening
    Events do not fire ... for example event "beforeinsert" - just do not react in any way ...

    What am I doing wrong? Or is it a bug?

    Here is my TreeStore code:
    PHP Code:
    Ext.define('App.Files.Store', {
        
    extend'Ext.data.TreeStore',
        
        
    autoLoadtrue,
        
        
    folderSorttrue,
        
        
    model'App.Files.Model',
        
        
    root: {
            
    id'',
            
    text'Site root',
            
    expandedtrue
        
    },
        
        
    proxy: new App.Proxy({
            
    module'Files'
        
    })
    }); 
    Here is Tree Panel code:
    PHP Code:
         ...
         
    initComponent: function() {
            var 
    me this;
            
            
            
    // Create tree
            
    var tree Ext.create('Ext.tree.Panel', {
                
    title'Browse',
                
    framefalse,
                
    region'west',
                
    collapsibletrue,
                
    floatablefalse,
                
    //displayField: 'name',
                
    splittrue,
                
    useArrowstrue,
                
    rootVisibletrue,
                
    width200,
                
    storeme.getStore()
            });    
            
            
    // Create DataView
            
    var view Ext.create('Ext.Panel', {
                
    title'Files',
                
    framefalse,
                
    region'center',
                
    collapsiblefalse,
                
    storeme.getStore()
            });        
            
            
    me.tree tree;
            
    me.view view;
            
            
    me.items = [me.treeme.view];
            
            
    me.callParent(arguments);
        },
        ... 

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    Quote Originally Posted by lambidu View Post
    In the Tree Panel "displayField" property does not work ... (I set the field "name" - and the text disappeared)
    What does App.Files.Model look like? Does it contains "name" field?

    Quote Originally Posted by lambidu View Post
    In Tree Store "autoLoad" property does not work ... (I set the "false" - but the data is all the same load automatically ...)
    TreeStore will force to load on its constructing if it has a root and autoLoad set to true or root is set expanded. So though you set autoLoad to false but you set the tree root to be expanded so it will cause tree store to load data from server.

    Filtering does not work ... no "initComponent", no "afterRender" ...
    I have tried function "filterBy" and "filters" but nothing happening
    Events do not fire ... for example event "beforeinsert" - just do not react in any way ...

    What am I doing wrong? Or is it a bug?
    Not sure what you mean here. Please be more specific and supply the code your code to reflect the situtations.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    -1
    lambidu is an unknown quantity at this point

      0  

    Default


    What does App.Files.Model look like? Does it contains "name" field?
    Yes, here is code:
    PHP Code:
    Ext.define('App.Files.Model', {
        
    extend'App.Model',
        
    fields: [
            
    'id'
            
    'path'
            
    'name'
            
    'text'
            
    'type'
            
    'leaf',
            
    'expanded',
        ],
        
    hasMany: {
            
    model'model'
            
    name'children'
        
    }
    }); 
    TreeStore will force to load on its constructing if it has a root and autoLoad set to true or root is set expanded. So though you set autoLoad to false but you set the tree root to be expanded so it will cause tree store to load data from server.
    OK, understand... Thanx


    Not sure what you mean here. Please be more specific and supply the code your code to reflect the situtations.
    I try to get filtered records...
    in "initComponent" function - nothing happen, no filter... no execution...

    PHP Code:
        initComponent: function() {
            var 
    me this;
            var 
    store me.getStore();
            
            
    store.filterBy(function(recordid) {
                
    console.log('Record to filter in initComponent: 'record);
                return 
    true;
            }, 
    store);
            
            
    // Create tree
            
    var tree Ext.create('Ext.tree.Panel', {
                
    title'Browse',
                
    framefalse,
                
    region'west',
                
    collapsibletrue,
                
    floatablefalse,
                
    //displayField: 'name',
                
    splittrue,
                
    useArrowstrue,
                
    rootVisibletrue,
                
    width200,
                
    storestore
            
    });    
            
            
    // Create DataView
            
    var view Ext.create('Ext.Panel', {
                
    title'Files',
                
    framefalse,
                
    region'center',
                
    collapsiblefalse,
                
    storeme.getStore()
            });        
            
            
    me.tree tree;
            
    me.view view;
            
            
    me.items = [me.treeme.view];
            
            
    me.callParent(arguments);
        }, 
    in "afterRender" function - nothing happen, no filter... no execution...

    PHP Code:
        afterRender: function() {
            var 
    me this;
            
            var 
    store me.getStore();
            
            
    store.filterBy(function(recordid) {
                
    console.log('Record to filter in afterRender: 'record);
                return 
    true;
            }, 
    store);
            
            
    me.tree.store store;
            
            
    me.callParent(arguments);
        }, 
    you can see in the screen I posted below the console log...
    2012-11-05_1528a.png
    here is no rows like "Record to filter in afterRender: {...}"
    function filterBy was not called...
    and I try to do something like this:
    PHP Code:
            var filter Ext.create('Ext.util.Filter', {
                
    filterFn: function(record) {
                    
    console.log('Record to filter in initComponent: 'record);
                    return 
    true;
                }
            });
            
            
    store.filters.filter(filter); 
    and again nothing...

    P.S. Sorry for my english...

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    -1
    lambidu is an unknown quantity at this point

      0  

    Default


    I read all posts from Google...
    Tried all solutions I've found there...
    but can't make this to work properly...

    http://screencast.com/t/0cWfHSJu

  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    -1
    lambidu is an unknown quantity at this point

      -1  

    Default


    bump

  6. #6
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    [QUOTE=lambidu;907638]Yes, here is code:
    PHP Code:
    Ext.define('App.Files.Model', {
        
    extend'App.Model',
        
    fields: [
            
    'id'
            
    'path'
            
    'name'
            
    'text'
            
    'type'
            
    'leaf',
            
    'expanded',
        ],
        
    hasMany: {
            
    model'model'
            
    name'children'
        
    }
    }); 
    App.Files.Model looks OK. What does the json data look like?

    I try to get filtered records...
    in "initComponent" function - nothing happen, no filter... no execution...

    PHP Code:
        initComponent: function() {
            var 
    me this;
            var 
    store me.getStore();
            
            
    store.filterBy(function(recordid) {
                
    console.log('Record to filter in initComponent: 'record);
                return 
    true;
            }, 
    store);
            
            
    // Create tree
            
    var tree Ext.create('Ext.tree.Panel', {
                
    title'Browse',
                
    framefalse,
                
    region'west',
                
    collapsibletrue,
                
    floatablefalse,
                
    //displayField: 'name',
                
    splittrue,
                
    useArrowstrue,
                
    rootVisibletrue,
                
    width200,
                
    storestore
            
    });    
            
            
    // Create DataView
            
    var view Ext.create('Ext.Panel', {
                
    title'Files',
                
    framefalse,
                
    region'center',
                
    collapsiblefalse,
                
    storeme.getStore()
            });        
            
            
    me.tree tree;
            
    me.view view;
            
            
    me.items = [me.treeme.view];
            
            
    me.callParent(arguments);
        }, 
    in "afterRender" function - nothing happen, no filter... no execution...

    PHP Code:
        afterRender: function() {
            var 
    me this;
            
            var 
    store me.getStore();
            
            
    store.filterBy(function(recordid) {
                
    console.log('Record to filter in afterRender: 'record);
                return 
    true;
            }, 
    store);
            
            
    me.tree.store store;
            
            
    me.callParent(arguments);
        }, 
    you can see in the screen I posted below the console log...
    Attachment 39820
    here is no rows like "Record to filter in afterRender: {...}"
    function filterBy was not called...
    and I try to do something like this:
    PHP Code:
            var filter Ext.create('Ext.util.Filter', {
                
    filterFn: function(record) {
                    
    console.log('Record to filter in initComponent: 'record);
                    return 
    true;
                }
            });
            
            
    store.filters.filter(filter); 
    and again nothing...
    There is no implementation of filterBy() method with Ext.data.TreeStore. It's just an empty method that is inherited from Ext.data.AbstractStore.

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