layui-資料表格排序
阿新 • • 發佈:2021-08-31
程式碼示例
見initSort方法
function useTable(table) { table.render({ elem: '#test' // ,url:"{:url('admin/statistical/order_num')}" , cellMinWidth: 80 //全域性定義常規單元格的最小寬度,layui 2.2.1 新增 , cols: [[ {field: 'statistical_date', width: 200, title: '時間'} , {field: 'turnover', width: 200, title: '銷售額'} , {field: 'play_type_count', width: 200, title: '微信支付'} , {field: 'invalid_order_count', width: 200, title: '作廢額度'} , {field: 'packing_amount', width: 200, title: '打包費'} , {field: 'shipping_fee', width: 200, title: '外送費'} , {field: 'coupon_amount', width: 200, title: '優惠卷金額'} , {field: 'reduce_amount', width: 300, title: '新客立減金額'} ]], data: information, page: true, initSort: { field: 'statistical_date', 需要排序的欄位 type: 'desc' 排序方式 } }); }