selectList

当字段传入了selectList之后,搜索表单将以下拉搜索的方式呈现,并且在表格中自动显示对应的值。

在下面的截图中,搜索表单展示了下拉列表,表格中ID为1的值是手机,所以能够匹配出来。


支持的传参形式

一维数组

支持传入一位数组。

  1. selectList: ['A', 'B']

例子

在下面的例子中,表格的分类实际上是1,所以匹配为B

  1. { field: 'cate_id', minWidth: 80, title: '商品分类', selectList: ['A', 'B'] },

一维对象

  1. selectList: { 1: '分类一', 2: '分类二' }

例子

  1. { field: 'cate_id', minWidth: 80, title: '商品分类', selectList: { 1: '分类一', 2: '分类二' } },

对象列表

  1. selectList: [{id:1,title:'手机'},{id:2,title:'电脑'}],
  2. selectValue: 'id',
  3. selectLabel: 'title'

可以设置一个对象列表,也是常见的在数据库select的数据。

注意,此时要同时设置:

  • selectValue
  • selectLabel

例子

  1. {
  2. field: 'cate_id',
  3. minWidth: 80,
  4. title: '商品分类',
  5. selectList: ea.getDataBrage('select_list_cate'),
  6. selectValue: 'id',
  7. selectLabel: 'title',
  8. defaultSearchValue: ea.getQueryVariable('cate_id', '')
  9. },

原文标题:selectList

原文文档:ulthon_admin

原文地址:https://doc.ulthon.com/read/augushong/ulthon_admin/64351fc5ea41b/zh-cn/2.x.html

原文平台:奥宏文档

2.x