Affichage des articles dont le libellé est Facing Problem while trying to create Custom Store. Afficher tous les articles
Affichage des articles dont le libellé est Facing Problem while trying to create Custom Store. Afficher tous les articles

jeudi 19 février 2015

Facing Problem while trying to create Custom Store

Hi ,

I Have created a custom store without specifying model (directly gave fields) using constructor in ExtJS 4.1.0 it was working fine without any issues or warnings pls find the below code :


Ext.define('ApplicationSetupStore', {

extend: 'Ext.data.Store',

config: {

url: null

},

constructor: function(currentObject) {


Ext.applyIf(this, {


fields: ['abc', 'abcd', 'abcde', 'abcdef'],

proxy: {

method: 'GET',

url: currentObject.url,

type: 'ajax',

extraParams: {

masiGroupCode: currentObject.groupCode,

masiSubCode: currentObject.subCode

},

reader: {

type: 'json',

root: 'data'

}

},

autoLoad: currentObject.autoLoad


});

this.callParent(arguments);

//everything breaks if you forget this

}

});


now i am trying to migrate from ExtJS 4.1.0 to 5.0.0 as there was an error message that you are trying to create store without Model so i created a model and trying to inject to Store :-


Ext.define('AppData', {

extend: 'Ext.data.Model',

fields: ['abc', 'abcd', 'abcde', 'abcdef'],

});

Ext.define('ApplicationSetupStore', {

extend: 'Ext.data.Store',

config: {

url: null

},

constructor: function(currentObject) {

Ext.applyIf(this, {

model: 'AppData',

proxy: {

method: 'GET',

url: currentObject.url,

type: 'ajax',

extraParams: {

masiGroupCode: currentObject.groupCode,

masiSubCode: currentObject.subCode

},

reader: {

type: 'json',

root: 'data'

}

},

autoLoad: currentObject.autoLoad


});

this.callParent(arguments);

}

});


now i am facing a problem when this.callParent(arguments); was executed

Object AppData has no method 'getProxy'


now i am totaly confused with this.callParent() ,what exactly it does. pls help me to overcome this issue.


Thank You






Facing Problem while trying to create Custom Store