首页 > 解决方案 > Dojo 对话框中的 FilteringSelect

问题描述

如何在对话框中实现 dojo 的过滤选择小部件。正如我在下面尝试过但没有运气。如果共享详细示例将有所帮助。我已经看过参考指南,但这并没有太大帮助。

var stateStore = new Memory({
        data: [
            {name:"Alabama", id:"AL"},
            {name:"Alaska", id:"AK"},
            {name:"American Samoa", id:"AS"},
            {name:"Arizona", id:"AZ"},
            {name:"Arkansas", id:"AR"},
            {name:"Armed Forces Europe", id:"AE"},
            {name:"Armed Forces Pacific", id:"AP"},
            {name:"Armed Forces the Americas", id:"AA"},
            {name:"California", id:"CA"},
            {name:"Colorado", id:"CO"},
            {name:"Connecticut", id:"CT"},
            {name:"Delaware", id:"DE"}
        ]
    });

 

var diaPrdTyp = new dijit.Dialog({
    content: filteringSelect,
    title: "Select Product Type",
    style: "width: 300px; height: 200px;",
    id:"prdtyp"
});

var filteringSelect = new FilteringSelect({
        id: "stateSelect",
        name: "state",
        value: "CA",
        store: stateStore,
        searchAttr: "name"
    }, "prdtyp");

标签: dojo

解决方案


content 参数用于纯文本或 html。要包含将在内容之后显示的小部件,您可以执行以下操作:

var diaPrdTyp = new dijit.Dialog({
    content: "Hello world",
    title: "Select Product Type",
    style: "width: 300px; height: 200px;",
    id:"prdtyp"
});
diaPrdTyp.domNode.appendChild(new FilteringSelect(...).domNode);

推荐阅读