Dojo,内容窗格未加载网格的 href 中的引用页面

Dojo, referenced page in href of Contentpane not loading grid

本文关键字:href 引用 网格 加载 Dojo      更新时间:2023-09-26
<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引用的页面内容。我可以在Firebug中看到xhrGet请求被触发并且数据即将到来。令人惊讶的是,如果我填充选择,这种技术会起作用。但是这个增强的网格没有得到渲染。

div

cmdGateway的溢出属性是什么?它应该是自动或滚动的。还可以尝试将网格的 autoHeight 属性设置为某个整数。

几天前,我也遇到了同样的数据网格问题。我建议从设置 cmdGatewaydiv 的高度开始,看看网格是否可见。