1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    10
    Vote Rating
    0
    twister0k is on a distinguished road

      0  

    Default How to update store form extjs2 to extjs4

    How to update store form extjs2 to extjs4


    I tryed migrate to extjs4, but 'migration pack' return massege '[BREAKING][4.0][Ext.data.Store]: A store was specified with no model, url, or fields configured. Please see the header docs for Ext.data.Store for details on properly setting up your data components. This is a breaking change that cannot be resolved in the compatibility layer! '
    My store looks like
    Code:
    Ext.namespace('App.data');
    
    Ext.define('App.data.Store', {
        extend: 'Ext.data.Store',
        constructor: function(config) {
            this.addEvents(
                'beforeupdate'
            );
            
            this.callParent(this, config);
            this.app_modFlag = false;
            this.app_Updates = null;
            
            this.on('load', function(store) {store.app_modFlag = false});
            this.on('update', function(store) {store.app_modFlag = true});
            this.on('add', function(store) {store.app_modFlag = true});
            this.on('clear', function(store) {store.app_modFlag = true});
            this.on('remove', function(store) {store.app_modFlag = true});
        },
        remoteSort: true,
        
        /**
            If true, object will automatically choose sort or local sort methods
                depending of number of data pages
        */
        autoChooseSortType: true,
        
        /* Overriden methods */
        
        load: function(options) {
            options = options || {};
            
            if (options.params && options.params.gridState && !isNaN(options.params.gridState.pageNo * options.params.gridState.pageSize)) {
                options.params.start = options.params.gridState.pageNo * options.params.gridState.pageSize;
                options.params.limit = options.params.gridState.pageSize;
            }
            if (options.params && options.params.gridState && options.params.gridState.sortField) {
                options.params.sort = options.params.gridState.sortField;
                options.params.dir = options.params.gridState.descendingOrder ? 'DESC' : 'ASC';
            }
            
            return App.data.Store.superclass.load.call(this, options);
        },
    
    
        loadRecords: function(o, options, success) {
            if (this.autoChooseSortType && this.reader && !isNaN(this.reader.pageNumber) && this.reader.pageNumber > 0) {
                this.remoteSort = this.reader.pageNumber > 1;
            }
            App.data.Store.superclass.loadRecords.call(this, o, options, success);
        },
        
        /**
            Returns number of pages current server storage
            Requires using of PagedListReader class as reader
        */
        getPageNumber: function() {
            return this.reader && !isNaN(this.reader.pageNumber) ? this.reader.pageNumber : Number.NaN;
        },..........
          .....................................................................................................................................................
    Code:
    Ext.define('AppRecord', {        extend: 'Ext.data.Model',
            fields: [
                {name: 'appId'},
                {name: 'name', sortType: Ext.data.SortTypes.asUCString},
                {name: 'clientName', sortType: Ext.data.SortTypes.asUCString},
                {name: 'creationTime', type: 'date'},
                {name: 'stage', type: 'int'},
                {name: 'type'}
            ]
        });
    
    
        var store = new App.data.Store({
            proxy: new App.data.DwrProxy({
                invoker: function(params, arg, cb) {
                    if (params.searchParams != null) {
                        AppManager.search(params.searchParams, params.gridState, cb);
                    } else if (params.removeId != null) {
                        AppManager.removeApp(params.removeId, params.gridState, cb);
                    } else {
                        AppManager.getAppList(params.gridState, null, cb);
                    }
                }
            }),
            
            reader: new App.data.PagedListReader({
                id: 'appId'
            }, AppRecord),
            sorters: App.util.makeSortInfo(App.appManager.gridState)
        });
    Any idea?

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    10
    Vote Rating
    0
    twister0k is on a distinguished road

      0  

    Default


    I forgot to assign my model to my store:
    Code:
    var store = new App.data.Store({    model: "AppRecord",//you need this added
        proxy: new App.data.DwrProxy({
            invoker: function(params, arg, cb) {
                if (params.searchParams != null) {
                    AppManager.search(params.searchParams, params.gridState, cb);
                } else if (params.removeId != null) {
                    AppManager.removeApp(params.removeId, params.gridState, cb);
                } else {
                    AppManager.getAppList(params.gridState, null, cb);
                }
            }
        }),
    
    
        reader: new App.data.PagedListReader({
            id: 'appId'
        }, AppRecord),
        sorters: App.util.makeSortInfo(App.appManager.gridState)
    
    });


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