1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Answers
    6
    Vote Rating
    0
    1099511627776 is on a distinguished road

      0  

    Default Answered: Custom field in TreeStore with a defined model

    Answered: Custom field in TreeStore with a defined model


    Hello world
    I have some unknown bug.
    In MVC Application I've define TreeStore with model:
    Code:
    Ext.define('ASV.model.documents',{
        extend: 'Ext.data.Model',
        fields:[
            {name: 'id',type:'int'},
            {name: 'text', type:'string'},
            {name: 'action', type:'string'},
            {name: 'leaf', type:'bool'}
        ]    
    });
    And assigned it to TreeStore:
    Code:
    Ext.define('ASV.store.documents',{
        extend: 'Ext.data.TreeStore',
        autoLoad:true,
        model:'documents',
    .........
    When I'm getting data from json response from server all field are assigned normally except custom "action' field.
    I've googled and found this topic: http://www.sencha.com/forum/showthre...om-a-tree-node, but that is not my case.

  2. This:

    Code:
    model:'documents',
    should be this:

    Code:
    model: 'ASV.model.documents',

  3. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Answers
    6
    Vote Rating
    0
    1099511627776 is on a distinguished road

      0  

    Default


    For now I've found a workaround.by using listeners to TreeStore:
    Code:
        listeners:{
            append:function(thisNode,newChildNode,index,eOpts){
                if( !newChildNode.isRoot() ){
                    newChildNode.set("action",newChildNode.raw.action);
                    console.log(newChildNode);
                }
            }
        }
    But I think tere might be a normal way to solve this problem

  4. #3
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    This:

    Code:
    model:'documents',
    should be this:

    Code:
    model: 'ASV.model.documents',

  5. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Answers
    6
    Vote Rating
    0
    1099511627776 is on a distinguished road

      0  

    Default


    Yes, I've just firuged it out Just before refreshing a forum thread

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar