tino7_03
29 Jan 2012, 10:52 PM
Is there a way to define a store in a MVC app with a dinamic url like this?
Ext.define('GpMobile.store.Customers', {
extend: 'Ext.data.Store',
config:{
model: 'GpMobile.model.Customers',
timeout : 3000,
proxy : {
url: this.getApplication().getController('Main').config.server.domain+"/service.aspx?methodName=sqlExecute&args=["+'"'+"sql"+'":"'+"SELECT [anagra].[an_conto], [anagra].[an_descr1] FROM anagra WHERE [anagra].[an_tipo]='C'"+'"]',
callbackKey: 'callback',
type : 'jsonp',
clearOnPageLoad: false,
reader:{
type : 'json',
rootProperty : 'results',
totalCount : 'total'
}
}
}
});
At app sturtup, when my Customers.js is loading I recive this error, because the store scope is DOMWindow:
Uncaught TypeError: Object [object DOMWindow] has no method 'getApplication'
Thanks in advance
Ext.define('GpMobile.store.Customers', {
extend: 'Ext.data.Store',
config:{
model: 'GpMobile.model.Customers',
timeout : 3000,
proxy : {
url: this.getApplication().getController('Main').config.server.domain+"/service.aspx?methodName=sqlExecute&args=["+'"'+"sql"+'":"'+"SELECT [anagra].[an_conto], [anagra].[an_descr1] FROM anagra WHERE [anagra].[an_tipo]='C'"+'"]',
callbackKey: 'callback',
type : 'jsonp',
clearOnPageLoad: false,
reader:{
type : 'json',
rootProperty : 'results',
totalCount : 'total'
}
}
}
});
At app sturtup, when my Customers.js is loading I recive this error, because the store scope is DOMWindow:
Uncaught TypeError: Object [object DOMWindow] has no method 'getApplication'
Thanks in advance