【发布时间】:2010-12-14 04:41:05
【问题描述】:
我正在使用 ExtJS3.3.1 并尝试从包含 JSON 对象的文件中加载网格。 它可以在 IE 加载带有数据的网格中正常工作,但不能在 Firefox 中工作。 这是简单的代码它不会给出任何错误和警告。
var store = new Ext.data.Store({
url: 'http://localhost/Vaishali/src/survey.html',
reader: new Ext.data.JsonReader({
root: 'data',
id: 'appeId',
totalProperty: 'total'
}, [{
name: 'appeId',
mapping: 'appeId'
}, {
name: 'survId',
mapping: 'survId'
}, {
name: 'location',
mapping: 'location'
}, {
name: 'surveyDate',
mapping: 'surveyDate'
}, {
name: 'surveyTime',
mapping: 'surveyTime'
}, {
name: 'inputUserId',
mapping: 'inputUserId'
}])
});
store.load();
var grid = new Ext.grid.GridPanel({
store: store,
columns: [{
header: "appeId",
width: 60,
dataIndex: 'appeId',
sortable: true
}, {
header: "survId",
width: 60,
dataIndex: 'survId',
sortable: true
}, {
header: "location",
width: 60,
dataIndex: 'location',
sortable: true
}, {
header: "surveyDate",
width: 100,
dataIndex: 'surveyDate',
sortable: true
}, {
header: "surveyTime",
width: 100,
dataIndex: 'surveyTime',
sortable: true
}, {
header: "inputUserId",
width: 80,
dataIndex: 'inputUserId',
sortable: true
}],
width: 540,
height: 200
});
所以你能告诉我为什么会发生这种情况。 哎呀 当我添加事件 onload 并在 mozilla firefox 中检查异常时,它将在该状态代码中显示异常,显示 0 和文本“连接失败”。 但在 IE 中它会给出正确的连接和结果。
【问题讨论】: