fastadmin 顶部搜索栏 定义数据

 

var table = $("#table");
            table.on('post-common-search.bs.table', function (event, table) {
                var form = $("form", table.$commonsearch);
                $("input[name='cpid']", form).addClass("selectpage").data("source", "gameset/getlist").data("primaryKey", "id").data("field", "name").data("orderBy", "id desc");
                Form.events.cxselect(form);
                Form.events.selectpage(form);
             });

             table.on('post-common-search.bs.table', function (event, table) {
                var form = $("form", table.$commonsearch);
                $("input[name='appid']", form).addClass("selectpage").data("source", "gameset/applist").data("primaryKey", "id").data("field", "name").data("orderBy", "id desc");
                Form.events.cxselect(form);
                Form.events.selectpage(form);
             });

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                toolbar: false,
                fixedColumns: true,
                fixedRightNumber: 1,
                showToggle: false,
                showColumns: false,
                // commonSearch: false,
                showExport: false,
                search: false,
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id'), operate: false},
                        {field: 'day', title: __('Day'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},                        
                        {field: 'cpid', title: '游戏', operate: 'LIKE'},
                        {field: 'appid', title:'包名', operate: 'LIKE'},
                        {field: 'money', title: __('Money'), operate: false},
                        {field: 'payuser', title: __('Payuser'), operate: false},
                        {field: 'reguser', title: __('Reguser'), operate: false},
                        {field: 'channel_id', title: '渠道', operate: false},
                        {field: 'paynum', title: __('Paynum'), operate: false},
                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                    ]
                ]
            });
          
            
            

 参考:实现fastadmin搜索栏中动态下拉列表搜索功能 - 灰信网(软件开发博客聚合)

注意:里面的具体的字段根据业务需要调整

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值