bootstrap-table参数
作者:互联网
table.bootstrapTable({ url:'/Home/geurl', //请求后台的URL() method:'get', //请求方式() toolbar:'#toolbar', //工具按钮用哪个容器 striped:true, //是否显示行间隔色 cache:false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性() pagination:true, //是否显示分页() sortable:false, //是否启用排序 sortOrder:'asc', //排序方式 queryParams:oTableInit.queryParams, //传递参数() sidePagination:'server', //分页方式:client客户端分页,server服务端分页() pageNumber:1, //初始化加载第一页,默认第一页 pageSize:10, //每页的记录行数() pageList:[10,25,50,100], //可供选择的每页的行数() search:true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大 strictSearch:true, showColumns:true, //是否显示所有的列 showRefresh:true, //是否显示刷新按钮 minimumCountColumns:2, //最少允许的列数 clickToSelect:true, //是否启用点击选中行 height:500, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 uniqueId:'ID', // 每一行的唯一标识,一般为主键列 showToggle:true, //是否显示详细视图和列表视图的切换按钮 cardView:false, //是否显示详细师徒 detailView:false, //是否显示父子表 column是:[{}], columns: [
[
{checkbox: true},
{field: 'id', title: __('Id'), sortable: true},
{field: 'group.name', title: __('Group')},
{field: 'username', title: __('Username'), operate: 'LIKE'},
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
{field: 'email', title: __('Email'), operate: 'LIKE'},
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
{field: 'avatar', title: __('Avatar'), formatter: Table.api.formatter.image, operate: false},
{field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
{field: 'gender', title: __('Gender'), visible: false, searchList: {1: __('Male'), 0: __('Female')}},
{field: 'score', title: __('Score'), operate: 'BETWEEN', sortable: true},
{field: 'successions', title: __('Successions'), visible: false, operate: 'BETWEEN', sortable: true},
{field: 'maxsuccessions', title: __('Maxsuccessions'), visible: false, operate: 'BETWEEN', sortable: true},
{field: 'logintime', title: __('Logintime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
{field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},
{field: 'jointime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
{field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
标签:__,operate,title,bootstrap,field,参数,table,formatter,true 来源: https://www.cnblogs.com/zjh0420/p/15124037.html