dialog - 如何将 Dojox.grid 放入 dijit.Dialog 中

标签 dialog grid dojo

我已经阅读了这里有关 dojox.Grid 的帖子,包括有关 tabcontainer 的帖子,但它似乎并没有解决我的问题。

我有一个以编程方式添加的网格,如果网格位于“主”标记中,它会很有效,但如果我将网格放入对话框中,它就会停止显示。

有什么想法可以解释为什么吗?使用dojo 1.3.1。

dijit.byId("myDialog").show();
var gridStore = new dojo.data.ItemFileReadStore({
      data : {
        identifier : "id",
        items      : [
                      {"id" : 1, "label" : "foo"},
                      {"id" : 2, "label" : "bar"},
                      {"id" : 3, "label" : "baz"}
        ]
      }
    });

    /* A simple layout that specifies column headers and
     * mappings to fields in the store */
    var gridLayout = [
            {name : "ID",    field : "id",    width : "50%"},
            {name : "Label", field : "label", width : "50%"}
    ];

    /* Programmatically construct a data grid */
    var grid = new dojox.grid.DataGrid({
                       store     : gridStore,
                       structure : gridLayout
               }, "gridNode");

    /* Tell the grid to lay itself out since
     * it was programmatically constructed */
    grid.startup();

标记是:

 <div dojoType="dijit.Dialog" id="myDialog" title="Multiple Addresses" style="width:400px;height:300px" >
    <div dojoType="dijit.layout.ContentPane" id="gridNode" style="positon:relative;width:100%;height:100%"></div>

感谢您的帮助, 规则

最佳答案

所以,我遇到的问题似乎源于没有在网格容器 div (gridNode) 上放置显式样式,一旦我这样做了:

<div dojoType="dijit.layout.ContentPane" id="gridNode" style="width:400px;height:300px"></div>

它开始工作了。

关于dialog - 如何将 Dojox.grid 放入 dijit.Dialog 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1223037/

相关文章:

html - Dojo dijit 动态添加 Div 按钮

android - 在对话框中的 gridview 中显示已安装的应用程序列表 - 不工作

java - 为什么我的 JLabel 没有显示?

css - Dojo 是否有一个未应用主题的默认 CSS 文件?

python - HTCondor 输出文件 : obtain created directory

Java GridBagLayout 内含组件

passwords - 如何在 dijit.form.TextBox 输入中显示浏览器保存的密码

javascript - 如何检测浏览器是否支持对话框

Java 将一个对话框停靠在另一个对话框上

android - 使用自定义对话框时无法使用 onDismiss() - Android