bootstrap-table自己配置
阿新 • • 發佈:2018-01-19
urn sortable rac var highlight fine attribute 按鈕 屬性
- function initTable(){
- var methodNameSearch=$("#methodNameSearch").val();
- var requestUrl = "/manage/json/validateMethodDefineSearchList.json?methodNameSearch=" + methodNameSearch;
- var $table = $(‘#table‘);
- $table.bootstrapTable({
- url: requestUrl,
- method: ‘get‘, //請求方式(*)
- //toolbar: ‘#toolbar‘, //工具按鈕用哪個容器
- striped: true, //是否顯示行間隔色
- cache: false, //是否使用緩存,默認為true,所以一般情況下需要設置一下這個屬性(*)
- pagination: true, //是否顯示分頁(*)
- sortable: false, //是否啟用排序
- sortOrder: "asc", //排序方式
- //queryParams: queryParams,//傳遞參數(*)
- pageNumber:1, //初始化加載第一頁,默認第一頁
- pageSize: 20, //每頁的記錄行數(*)
- pageList: [10, 20, 50, 100], //可供選擇的每頁的行數(*)
- //search: true, //是否顯示表格搜索,此搜索是客戶端搜索,不會進服務端
- //strictSearch: true,
- //showColumns: true, //是否顯示所有的列
- //showRefresh: true, //是否顯示刷新按鈕
- minimumCountColumns: 2, //最少允許的列數
- clickToSelect: true, //是否啟用點擊選中行
- uniqueId: "id", //每一行的唯一標識,一般為主鍵列
- showToggle:false, //是否顯示詳細視圖和列表視圖的切換按鈕
- sidePagination: "server", //服務端處理分頁
- columns: [
- {title: ‘id‘,field: ‘id‘, visible: false, align: ‘center‘,valign: ‘middle‘},
- {title: ‘名稱‘,field: ‘methodName‘,align: ‘center‘,valign: ‘middle‘},
- {title: ‘<span style="font-family:Microsoft YaHei;">類名</span>‘,field: ‘methodCode‘,align: ‘center‘,valign: ‘middle‘},
- {title: ‘組名隱藏‘,field: ‘methodGroup‘, visible: false, align: ‘center‘,valign: ‘middle‘},
- {title: ‘組名‘,field: ‘methodGroupName‘,align: ‘center‘,valign: ‘middle‘},
- {title: ‘操作‘,field: ‘#‘,align: ‘center‘,
- formatter:function(value,row,index){
- var e = ‘<a href="#" mce_href="#" onclick="onEditClick(\‘‘+ row.id + ‘\‘,\‘‘ +row.methodName+ ‘\‘,\‘‘ +row.methodCode+ ‘\‘,\‘‘ +row.methodGroup+‘\‘)">編輯</a> ‘;
- var d = ‘<a href="#" mce_href="#" onclick="onDeleteClick(\‘‘+ row.id +‘\‘)">刪除</a> ‘;
- return e+d;
- }
- }
- ]
- });
- }
[html] view plain copy
- function onEditClick(id, methodName, methodCode, methodGroup) {
- var requestUrl = "/manage/validateMethodDefineAdd.vm?validateMethodDefineId=" + id
- +"&methodName=" + methodName+"&methodCode=" + methodCode+"&methodGroup=" + methodGroup;
- window.location = requestUrl;
- }
bootstrap-table自己配置