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 Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Answers
    540
    Vote Rating
    309
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      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

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