带有选择字段的dgrid

时间:2013-01-17 08:22:48

标签: dojo dgrid

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

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

2 个答案:

答案 0 :(得分:2)

尝试这样的事情:

"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

答案 1 :(得分:2)

基于frederic回答的答案:

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