2013-01-17 41 views
1

我看了整个网络上的这个“简单”的问题没有答案!
如何嵌入一个选择输入字段到像本例中,dgrid:
假设我们有此列:dgrid与选择字段

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

回答

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

+0

非常感谢,我在链接上的其他测试文件之一找到答案。 以为我想知道为什么这个代码很难在网上找到? 我很努力地找到答案,直到你帮助我。再次感谢 – Tarek

2

基于frederic的答案回答:

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