1. #1
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    54
    Vote Rating
    1
    maikhorma is on a distinguished road

      0  

    Default specify function for root property

    specify function for root property


    I'm trying to specify a function for a a root property on one of my store readers, but architect just escapes the characters. I've tried using the override but apparently I don't know how to do it right, because it is ignored. Anyone know how I can do this?

    Thanks

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    You can use an override for this problem. Could you post the code that you attempted to use?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    54
    Vote Rating
    1
    maikhorma is on a distinguished road

      0  

    Default


    I've tried this way but it doesn't appear either methods are being called (no console messages).
    PHP Code:
    Ext.define('AtlasUI.store.override.ExamPrograms', {
        
    requires'AtlasUI.store.ExamPrograms'}, function() {
        
    Ext.override(AtlasUI.store.ExamPrograms, {
             
    initComponent : function(cfg) {
                
    console.debug('init');
                
    this.callOverridden(cfg);
            },
            
    constructor : function(cfg) {
                
    console.debug('construct');
                
    this.callOverridden(cfg);
            }    
    });}); 
    Could this be related to this? http://www.sencha.com/forum/showthread.php?185715-Can-I-override-Store-s-constructor-or-component-s-initComponent()

    UPDATE: Forgot to mention my deployment is using ExtJS 4.1

    Gave this a try with no help
    PHP Code:
    Ext.define('AtlasUI.store.override.ExamPrograms', {
       
    requires'AtlasUI.store.ExamPrograms'}, function() {
       
    Ext.override(AtlasUI.store.ExamPrograms, {
            
    proxy: {
                       
    root: function(val){console.debug(val);return 'result.examProgram';}
                   }
               }
       });}); 
    Thanks

Thread Participants: 1