FastAdmin 表格排序


找到对应的js

public/assets/js/backend/user/user.js
table.bootstrapTable({
    url: $.fn.bootstrapTable.defaults.extend.index_url,
    pk: 'id',
   sortName: 'weigh',//默认排序字段 sortOrder:'asc',//默认排序方式
    escape: true,
    search: true,
    pagination: true,
    pageList: [10, 20, 50, 'All'],
    commonSearch: true,
    columns: [
        [
            { checkbox: true },
            { field: 'id', title: __('Id'), sortable:true},     //字段使用排序

利用sortName可以进行默认排序,如果设定了这个那么sortOrder则不生效

另外再罗列一些其他功能,字段加添加 sortable:true 就可以动态搜索并排序了

 

原文地址:http://www.aumoc.com/index.php/2020/02/25/fastadmin-table-bootstraptable-sort-order/

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM