1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    NL
    Posts
    607
    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
    231
    Vote Rating
    6
    bseddon is on a distinguished road

      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
    231
    Vote Rating
    6
    bseddon is on a distinguished road

      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

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