1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    NL
    Posts
    608
    Vote Rating
    1
    mdissel is on a distinguished road

      0  

    Default treestore / model override isLeaf implementation

    treestore / model override isLeaf implementation


    How can i override the isLeaf() implementation? This is my model

    Code:
    Ext.define('Item', {
    	extend: 'Ext.data.Model',
        fields: [
    		'name', 
    		'itemCode',
    		'url',
    		'siteURL',
    		'category',
    		'client',
    		{name:'userName', mapping:'user > userName', type:'string'}
    	],
    	isLeaf:function(){
    		return Ext.isEmpty(this.get('category')) && Ext.isEmpty(this.get('userName'));
    	}
    });
    but the isLeaf function is never called.. I can't change the server side response. How can i map fieldvalues from my server side response into the defaults node fields?

    Thanks

  2. #2
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    257
    Vote Rating
    8
    bseddon will become famous soon enough

      0  

    Default


    Good question. Did you ever work out how to have the isLeaf function return an appropriate value?

  3. #3
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    257
    Vote Rating
    8
    bseddon will become famous soon enough

      0  

    Default


    Figured it out for my scenario. It was necessary to make sure the JSON response includes an appropriate boolean value for a 'leaf' property and to make sure the model definition for the 'leaf' field is marked as boolean. Then, for me at least, the model's isLeaf() function then just worked.

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