目录

Smart Select

描述 (Description)

智能选择是一种通过使用复选框和无线电输入将表单选择更改为动态页面的简便方法。

我们可以使用下表中指定的各种类型的智能选择 -

S.No 类型和描述
1 智能选择布局

智能选择布局使用smart-select类在select元素内定义列表视图。

2 使用搜索栏进行智能选择

智能选择使用search bar搜索元素,并通过将data-searchbar类设置为true来启用它。

3 自定义页面标题和反向链接文本

您可以使用data-page-titledata-back-text属性为智能选择设置自定义页面标题和反向链接。

4 在Popup中打开

通过使用data-open-in属性弹出,可以将弹出选项打开为弹出popup

5 在Picker中打开

通过将data-open-in属性设置为picker,可以将Smart select显示为picker模态。

6 自定义图标,颜色和图像

您可以分别使用data-option-icondata-option-colordata-option-image属性在智能选择上定义自定义图标,颜色或图像。

7 多选和Optgroup

智能选择允许使用multipleoptgroup属性使用多个选择和组选项。

8 Multiple Select and Maxlength

智能选择允许使用maxlength属性选择有限数量的项目。

您可以使用更多类型的智能选择,可以在下表中列出的不同场景中使用 -

S.No 类型和描述 属性
1

Close Smart Select On User Select

您可以在用户选择任何选项时关闭智能选择。

data-back-on-select =“true”
2

Smart Select With Virtual List

如果您有很多选项,虚拟列表可以与智能选择一起使用。

data-virtual-list =“true”
3

Smart Select Color Themes

您可以在智能选择页面上为表单和导航栏指定颜色主题。

data-form-theme =“color”

data-navbar-theme =“color”

4

Set Smart Select Value By Option Text

可以使用选项值设置智能选择的值。

smart-select-value
5

Open Smart Select Using JavaScript

您可以使用JavaScript方法打开智能选择。

myApp.smartSelectOpen(smartSelect)

  • smartSelect - 用于打开指定智能选择的HTMLElement或字符串参数。

6

Adding Options Dynamically

您可以动态地向智能选择添加选项,即使它们已经打开。

myApp.smartSelectAddOption(select,optionHTML,index)

  • smartSelect - 用于打开指定智能选择的HTMLElement或字符串参数。

  • optionHTML - 必需的字符串元素,可用于添加HTML选项。

  • index - 它指定新选项的索引号。

↑回到顶部↑
WIKI教程 @2018