Threaded View

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    7
    Vote Rating
    0
    Answers
    1
    antiplaka is on a distinguished road

      0  

    Default Answered: Overrideing Ext.data.Store methods breaks functionality.

    Answered: Overrideing Ext.data.Store methods breaks functionality.


    Good day. I ran into some trouble with Ext.data.Store class. Maybe i've got wrong idea about the Class system?

    I want to do pre-processing of incoming data.
    There is my code :

    Code:
        Ext.define('App.store.PagesStore', {
            extend  : 'Ext.data.Store',
            requires: ['App.model.Page'],
    
            config: {
                model     : 'App.model.Page',
                data        : pages,
            },
    
            constructor: function(config) {
                this.callParent(config);
            },
    
            applyData : function(data) {
                this.callParent(data);
            },
        });
    Overriding the constructor makes Ext.StoreManager fail with lookup and overridden applyData passes only one record to the store.

  2. Passing arguments to parent's function seems to do the trick :

    Code:
        Ext.define('App.store.PagesStore', {
            extend  : 'Ext.data.Store',
            requires: ['App.model.Page'],
    
            config: {
                model     : 'App.model.Page',
                data        : pages,
            },
    
            constructor: function(config) {
                 this.callParent(arguments);
             },
     
             applyData : function(data) {
                 /* do the data manipulations */
                 this.callParent(arguments);
             },
        });