<script type="text/javascript">
dojo.ready(function(){
var dataStore;
var grid;
dojo.xhrGet({
url: "/mediation1.0.1/processConfig/getAll",
handleAs: "json",
headers:{"Accept" : "application/json"}
}).then(function(data) {
dataStore = new dojo.data.ObjectStore({ objectStore:new dojo.store.Memory({ data: data }) });
grid = new dojox.grid.EnhancedGrid({
id : "gatewayGrid",
name : "gatewayGrid",
store : dataStore,
query : {id : "*"},
plugins: {indirectSelection: true,
pagination: {
pageSizes: ["10", "20", "30", "All"],
description: true,
sizeSwitch: true,
pageStepper: true,
gotoButton: true,
maxPageStep: 2,
position: "bottom"
}},
selectionMode:'single',
structure : [
{name:"ID", field:"id",hidden:"true"},
{name : "Name", field : "name", width : "auto"},
{name : "IP Address", field : "_item", width : "auto",
formatter: function(item){
return item.collectorParams.host;
}}
,
{name : "Cron Interval", field : "cronExpression", width : "auto"},
{name : "Status", field : "active", width : "auto"}
]
}, document.createElement('div'));
dojo.byId("cmdGateway").appendChild(grid.domNode);
grid.startup();
});
});
</script>
<div id="switchConfigBorder" dojoType="dijit.layout.BorderContainer"
style="background-color: white">
<div id="switchConfigWholePane" dojoType="dojox.layout.ContentPane"
style="background-color: white" region="top">
<div id="cmdGateway">
</div>
</div>
</div>
这是从带有 href 的 dojox.layout.ContentPane 引用的页面内容。我可以在萤火虫中看到 xhrGet 请求被触发并且数据即将到来。令人惊讶的是,如果我填充选择,这种技术就会起作用。但是这个 EnhancedGrid 没有被渲染。