Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Threaded View

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default Answered: extjs 4.1 tree add new node with server changes

    Answered: extjs 4.1 tree add new node with server changes


    In my application, the user can add some nodes to a tree node. The tree is connected to a store which has autoload and autosync true.The code to add a new node is this one:
    Code:
    var window = button.up('window');
    var form = window.getComponent('NodeForm').getForm();
    var store = Ext.getStore('NodeStore');
    var parentDir = window.parentDir;
    record = window.record ? window.record : NuageApp.model.Node.create();
    
    
    if (form.isValid()) {
        form.updateRecord(record);
        if (window.record) {
            store.sync();
        } else {
            parentDir.appendChild(record);
        }
        window.destroy();
    }
    Then the server will be notified and returns this json:
    Code:
    {
       "id": "4faccf93f597090d14000010/home/user/file",
       "text": "test file",
       "type": "file",
       "icon": "/images/icons/page.png",
       "expanded": true,
       "children": []
    }
    The property text and icon changed server side but the store does not update the record.


    Code:
    Here is the configuration of the store:
    Ext.define('MyApp.store.NodeStore', {
        extend: 'Ext.data.TreeStore',
        requires: [
            'MyApp.model.Node'
        ],
    
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                autoLoad: true,
                autoSync: true,
                storeId: 'MyJsonTreeStore1',
                model: 'MyApp.model.Node',
                proxy: {
                    type: 'rest',
                    reader: {
                        type: 'json',
                        idProperty: 'id'
                    },
                    writer: {
                        type: 'json',
                        nameProperty: 'text'
                    }
                },
                sorters: {
                    property: 'text'
                },
    
    
            }, cfg)]);
        },
    
    
    });



  2. Try to return json data as an array:
    Code:
    [{
       "id": "4faccf93f597090d14000010/home/user/file",
       "text": "test file",
       "type": "file",
       "icon": "/images/icons/page.png",
       "expanded": true,
       "children": []
    }]
    Or
    Code:
    { 
        "success": true,
        "children": [{
           "id": "4faccf93f597090d14000010/home/user/file",
           "text": "test file",
           "type": "file",
           "icon": "/images/icons/page.png",
           "expanded": true,
           "children": []
       }]
    }

Thread Participants: 2

Tags for this Thread