【问题标题】:dgrid with select field带有选择字段的 dgrid
【发布时间】:2013-01-17 08:22:47
【问题描述】:

我在网上寻找这个“简单”的问题却没有答案!
如何将选择输入字段嵌入到 dgrid 中,如下例所示:
假设我们有这个专栏:

editor({ 
                    label: "name", 
                    autoSave:true, 
                    field: "f_name", 
                    className: 'style4' 
            }, "text", "dblclick") 

【问题讨论】:

    标签: dojo dgrid


    【解决方案1】:

    试试这样的:

    "dgrid.editor({
                        field: 'state',
                        editorArgs: {store: stateStore, style: 'width:120px;', maxHeight: -1}
                    }, dijit.form.Select)"
    

    示例如下:https://github.com/SitePen/dgrid/blob/master/test/GridFromHtml_Editors.html

    【讨论】:

    • 非常感谢,我在链接上的其他测试文件之一中找到了答案。我想我想知道为什么这段代码在网上很难找到?在你帮助我之前,我努力寻找答案。再次感谢
    【解决方案2】:

    基于弗雷德里克的答案:

    editor({
        label: "subject",
        field: "subject",
        editorArgs: {
            style: "width:75px;",
            options: [
                {value: "true", label: "true"},
                {value: "false", label: "false"}
            ]
        }
    }, Select, "dblclick")
    

    【讨论】:

      猜你喜欢
      • 2013-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-07
      • 1970-01-01
      • 1970-01-01
      • 2022-06-27
      • 2021-11-19
      相关资源
      最近更新 更多