bootstrap-table的一些配置參數例子

[html]  view plain  copy
 
  1. $('#reportTable').bootstrapTable({  
  2.   method: 'post',  
  3.   url: '/qStock/AjaxPage',  
  4.   dataType: "json",  
  5.   striped: true,     //使表格帶有條紋  
  6.   pagination: true, //在表格底部顯示分頁工具欄  
  7.   pageSize: 22,  
  8.   pageNumber: 1,  
  9.   pageList: [10, 20, 50, 100, 200, 500],  
  10.   idField: "ProductId",  //標識哪一個字段爲id主鍵  
  11.   showToggle: false,   //名片格式  
  12.   cardView: false,//設置爲True時顯示名片(card)佈局  
  13.   showColumns: true, //顯示隱藏列    
  14.   showRefresh: true,  //顯示刷新按鈕  
  15.   singleSelect: true,//複選框只能選擇一條記錄  
  16.   search: false,//是否顯示右上角的搜索框  
  17.   clickToSelect: true,//點擊行便可選中單選/複選框  
  18.   sidePagination: "server",//表格分頁的位置  
  19.   queryParams: queryParams, //參數  
  20.   queryParamsType: "limit", //參數格式,發送標準的RESTFul類型的參數請求  
  21.   toolbar: "#toolbar", //設置工具欄的Id或者class  
  22.   columns: column, //列  
  23.   silent: true,  //刷新事件必須設置  
  24.   formatLoadingMessage: function () {  
  25.     return "請稍等,正在加載中...";  
  26.   },  
  27.   formatNoMatches: function () {  //沒有匹配的結果  
  28.     return '無符合條件的記錄';  
  29.   },  
  30.   onLoadError: function (data) {  
  31.     $('#reportTable').bootstrapTable('removeAll');  
  32.   },  
  33.   onClickRow: function (row) {  
  34.     window.location.href = "/qStock/qProInfo/" + row.ProductId;  
  35.   },  
  36. });  



bootstrap-table帶參到後臺去的代碼html

 

[html]  view plain  copy
 
  1. function queryParams(params) {  //配置參數  
  2.     var temp = {   //這裏的鍵的名字和控制器的變量名必須一直,這邊改動,控制器也須要改爲同樣的  
  3.       pageSize: params.limit,   //頁面大小  
  4.       pageNumber: params.pageNumber,  //頁碼  
  5.       minSize: $("#leftLabel").val(),  
  6.       maxSize: $("#rightLabel").val(),  
  7.       minPrice: $("#priceleftLabel").val(),  
  8.       maxPrice: $("#pricerightLabel").val(),  
  9.       Cut: Cut,  
  10.       Color: Color,  
  11.       Clarity: Clarity,  
  12.       sort: params.sort,  //排序列名  
  13.       sortOrder: params.order//排位命令(desc,asc)  
  14.     };  
  15.     return temp;  
  16.   }  
相關文章
相關標籤/搜索