我有一个像
[
{
"switchType": {
"name": "sansayv15",
"perform": false,
"createBy": null,
"createDate": null,
"intId": 1,
"id": 1
},
"collectorType": {
"name": "FTP",
"perform": false,
"createBy": null,
"createDate": null,
"intId": 1,
"id": 1
},
"fileType": {
"name": "TEXT",
"perform": false,
"createBy": null,
"createDate": null,
"intId": 1,
"id": 1
},
"exportType": {
"name": "DB",
"perform": false,
"createBy": null,
"createDate": null,
"intId": 1,
"id": 1
},
"linesToSkip": "1",
"checkValidate": "true",
"checkDuplicate": "true",
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/panamaxmediation",
"tableName": "sansayv15",
"ftpIp": null,
"ftpPort": null,
"ftpUserName": null,
"ftpPassword": null,
"sftpIp": null,
"sftpPort": null,
"sftpUserName": null,
"sftpPassword": null,
"name": "sansayv15",
"password": "root",
"userName": "root",
"perform": false,
"createBy": null,
"createDate": null,
"intId": 1,
"id": 1
}
]
这是我服务的输出。我在两个存储 JsonResStore 和 ObjectStore 中使用此输出而不是 MemoryStore 用于 EnhancedGrid
我在变量中定义了网格结构,
var templateGridStructure = [ {
name : "ID",
field : "id",
hidden : "true"
}, {
name : "Name",
field : "name",
width : "auto"
}, {
name : "Collection Method",
field : "_item",
width : "auto",
formatter : function(item) {
return item.collectorType.name;
}
}, {
name : "Export Method",
field : "_item",
width : "auto",
formatter : function(item) {
return item.exportType.name;
}
}, {
name : "Source File Type",
field : "_item",
width : "auto",
formatter : function(item) {
return item.fileType.name;
}
},{
name : "Duplication Check",
field : "checkDuplicate",
width : "auto",
},{
name : "Validation Check",
field : "checkValidate",
width : "auto",
},{
name : "Switch Type",
field : "_item",
width : "auto",
formatter : function(item) {
return item.switchType.name;
}
} ];
当我在 EnhancedGrid 中使用 ObjectStore
templateGrid = new dojox.grid.EnhancedGrid({
id : "templateGrid",
name : "templateGrid",
store : objectStore});
网格显示正确的数据但是当我在 EnhancedGrid 中使用 JsonRestStore
templateGrid = new dojox.grid.EnhancedGrid({
id : "templateGrid",
name : "templateGrid",
store : jsonRestStore});
我得到错误 - 网格没有显示数据。
这两个商店之间定义列结构有什么区别吗??