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