dojo - 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");
解决方案
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);
推荐阅读
- javascript - React hooks,卸载组件时,重置 Redux 数据
- git - Azure DevOps - 在另一个 PR 完成后自动创建 PR
- java - Spring 不会使用 @JsonCreator 解析
- css - 如何使2个网格站在同一条线上?
- typescript - Svelte Typescript - 提取道具类型
- node-red - 打开 RowDataPacket 内容(红色节点)
- bash - -bash:yarn:即使在全局安装后也找不到命令
- java - 如何将返回类型更改为映射或对象?
- python - 用于张量的 scipy 和 numpy 中的 SVD
- python - 按两列对数据框进行排序 - 这样两列的顺序就无关紧要了