有时候我们希望打开一个列表页面时,提前进行一些搜索设置,或者根据关联情况只查询关联的数据,我们可以这样做.

{ 
    field: 'cate.id', 
    minWidth: 80, 
    title: '商品分类', 
    hide: true, 
    defaultSearchValue: ea.getQueryVariable('cate_id', '') 
},

我们只需要在表格列的配置项中,使用defaultSearchValue参数,就可以在加载表格时,自动进行搜索.

在这案例中,我们使用getQueryVariable的助手函数从链接中获取参数.

defaultSearchValue仅支持字符串,且字符串长度为0时,不会有任何动作.

这个操作会覆盖表格原有的where配置.

原文标题:defaultSearchValue

原文文档:ulthon_admin

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

原文平台:奥宏文档

2.x