Hi,
I've got a MVC application., where I use treestore as menu. The treestore is loading from a php script.
My store:
Code:
Ext.define('Statistics.store.Menu', {
    extend: 'Ext.data.TreeStore',
    model: 'Statistics.model.Menu',
    storeId: 'MenuStore',
    autoLoad: true,
    autoSync: true,
    
    proxy   : {
        type : 'ajax',
        url  : 'resources/scripts/get_menu.php?callback=1',
        reader: {
            type: 'json',
            successProperty: 'success'
        }
    }
    
    
});
And the model definition:
Code:
Ext.define('Statistics.model.Menu', {
    extend: 'Ext.data.Model',
    
    fields: [
        {name: 'text', type: 'string'},
        {name: 'dbName', type: 'string'},
        {name: 'leaf', type: 'boolean'},
        {name: 'expanded', type: 'boolean', defaultValue: false} 
    ],


});
When the application starts, it ajax requests the get_menu.php script
Code:
localhost/flexibee/resources/scripts/get_menu.php?callback=1&_dc=1356538422103&node=root&id=root
After the application starts, the treepanel looks as following:
Code:
Home
+Node1
+Node2
+Node3
+Node4
+Node5
But when I try to expand any of the nodes, it fires another ajax request
Code:
localhost/flexibee/resources/scripts/get_menu.php?callback=1&_dc=1356538710990
and it became this:
Code:
Home
Home
--Leaf1
--Leaf2
+Node2
+Node3
Home
--Leaf1
--Leaf2
+Node5