如何将 html 数据列表字段添加到流星 aldeed:autoform?
How to add a html datalist field to a meteor aldeed:autoform?
我用 aldeed:autoform 中的集合填充了 select 输入字段。
实地申报
{{> afFormGroup name="patientID" type="select" options=patientIDs}}
帮手
patientIDs:function () {
return Meteor.users.find({}).map(function (user) {
return {label: user.profile.firstName, value: user._id};
});
}
但结果是下拉列表太大,无法 select 选择。因此我需要在自动窗体中实现类似于 HTML datalist 的功能。如何在流星中实现这个 aldeed:autoform?
有一个用于自动表单的 select2 插件,它可能会帮助您获得所需的结果。参见 here。
我用 aldeed:autoform 中的集合填充了 select 输入字段。
实地申报
{{> afFormGroup name="patientID" type="select" options=patientIDs}}
帮手
patientIDs:function () {
return Meteor.users.find({}).map(function (user) {
return {label: user.profile.firstName, value: user._id};
});
}
但结果是下拉列表太大,无法 select 选择。因此我需要在自动窗体中实现类似于 HTML datalist 的功能。如何在流星中实现这个 aldeed:autoform?
有一个用于自动表单的 select2 插件,它可能会帮助您获得所需的结果。参见 here。