[英]Extjs store.proxy.extraParams is undefined only in Internet Explorer
I have an ExtJs store. 我有一个ExtJs商店。
var fieldsStore = new Ext.create('Ext.data.Store', {
model : 'FieldsModel',
proxy : {
type : 'ajax',
url : 'queryBuilder_getQueryDetails',
extraParams : {
queryID : queryID
},
reader : {
type : 'json'
}
},
listeners : {
load : function(store, records, successful, operation, eOpts) {
if (successful) {
records.forEach(function(rec) {
// default settings: if datatype is INTEGER - SUM
if (rec.get('fieldType') == 'INTEGER') {
rec.set('fieldSettingKey', 'SUM');
rec.set('fieldSettingValue', 'Sum');
} else {
// else select ROWHEADER by default
rec.set('fieldSettingKey', 'ROWHEADER');
rec.set('fieldSettingValue', 'Row Header');
}
});
store.commitChanges();
}
}
}
});
Now when I do fieldsStore.proxy.extraParams.queryID = arrQuery.queryId;
现在,当我执行
fieldsStore.proxy.extraParams.queryID = arrQuery.queryId;
, I am getting an error in Internet Explorer. ,我在Internet Explorer中遇到错误。 Not in Chrome or FF but only in IE.
不在Chrome或FF中,仅在IE中。
It says fieldsStore.proxy.extraParams
is null or undefined. 它说
fieldsStore.proxy.extraParams
为空或未定义。
Can anyone help why this is happening only in IE? 任何人都可以帮助为什么这仅在IE中发生吗?
you can also try this 你也可以试试这个
fieldsStore.getProxy().setExtraParam( 'queryID', arrQuery.queryId ); fieldsStore.getProxy()。setExtraParam('queryID',arrQuery.queryId);
找到了替代方法 。
fieldsStore.proxy.extraParams = {queryID : arrQuery.queryId};
try with: 尝试:
fieldsStore.getProxy().extraParams = arrQuery.queryId;
EDIT: 编辑:
You can erase it, when you do: 您可以在执行以下操作时将其擦除:
fieldsStore.getProxy().extraParams = {'queryID' : queryID} this code define your extraParams config automatically. fieldsStore.getProxy()。extraParams = {'queryID':queryID}此代码自动定义您的extraParams配置。
var fieldsStore = new Ext.create('Ext.data.Store', {
model : 'FieldsModel',
proxy : {
type : 'ajax',
url : 'queryBuilder_getQueryDetails',
//-----------------------
extraParams : {
queryID : queryID
},
//-----------------------
reader : {
type : 'json'
}
},
...
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.