简体   繁体   English

Dojo,Contentpane的href中的引用页面未加载网格

[英]Dojo, referenced page in href of Contentpane not loading grid

<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>

This is the contents of the page which is referenced from the dojox.layout.ContentPane with href. 这是从dojox.layout.ContentPane使用href引用的页面内容。 I can see in the firebug that xhrGet request is fired and data is coming. 我在萤火虫中看到xhrGet请求被触发并且数据即将到来。 Surprisingly, this technique work if I populate select. 出乎意料的是,如果我填充select,则此技术有效。 But this EnhancedGrid is not getting rendered. 但是,此EnhancedGrid并未得到渲染。

what is the overflow property of div cmdGateway? div cmdGateway的溢出属性是什么? It should be auto or scroll. 它应该是自动或滚动的。 Also try setting the autoHeight property of grid to some integer. 也可以尝试将grid的autoHeight属性设置为某个整数。

Couple of days back I also faced same problem with DataGrid. 几天前,我也遇到了DataGrid的相同问题。 I will suggest to start with setting the height of cmdGateway div and see if Grid is viewable. 我建议从设置cmdGateway div的高度开始,看看Grid是否可见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM