我试图将InlineEditBox与下面的dijit/form/ComboBox一起使用
var items = [
{name: 'new'},
{name: 'processed'},
{name: 'approved'},
{name: 'running'},
{name: 'archived'}
]
new ComboBox({
store: new Memory({data: items}),
searchAttr: 'name',
style: 'width: 200px;'
}, 'status').startup()我第一个“天真”的方法是:
new InlineEditBox({
store: new Memory({data: items}),
searchAttr: 'value',
style: 'width: 200px;',
editor: ComboBox
}, 'status').startup() 结果是,显示了内联框,您可以单击该框,但会显示空ComboBox。我尝试过纳布尔论坛的一种方法
new InlineEditBox({
editor: new ComboBox({
store: new Memory({data: items}),
searchAttr: 'value',
style: 'width: 200px;',
})}, 'status').startup()然而,它也不起作用。
我的问题是:除了简单的文本编辑器之外,是否有方法将dijit/InlineEditBox与dijit控件一起使用,该组件的编写仅仅是为了与少数受支持的控件合作?
发布于 2014-06-13 09:48:57
我找到了一个答案:您需要使用editorParams。此参数是具有赋予编辑器的属性的对象。Dojo文档没有直接记录它,但在示例中使用了它。
工作ComboBox与InlineTextEdit:
new InlineEditBox({
editor: ComboBox,
editorParams: {
store: new Memory({data: items}),
searchAttr: 'name'
}
}, 'type').startup() https://stackoverflow.com/questions/24187045
复制相似问题