欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Bootstrap Table使用整理(四)之工具欄

 更新時(shí)間:2017年06月09日 10:19:08   作者:天馬3798  
這篇文章主要介紹了Bootstrap Table使用整理(四)之工具欄的相關(guān)資料,需要的朋友可以參考下

相關(guān)閱讀:

Bootstrap Table使用整理(一) http://www.dbjr.com.cn/article/115789.htm

Bootstrap Table使用整理(二)  http://www.dbjr.com.cn/article/115791.htm

Bootstrap Table使用整理(三)  http://www.dbjr.com.cn/article/115795.htm

Bootstrap Table使用整理(五)之分頁組合查詢 http://www.dbjr.com.cn/article/115785.htm

一、啟用默認(rèn)支持的工具欄

/* 
* data-search 是否顯示搜索框 
* data-show-refresh 是否像是刷新按鈕,注:刷新操作會重新請求數(shù)據(jù),并帶著請求參數(shù) 
* data-show-toggle 是否顯示面板切換按鈕 
* data-show-columns 是否顯示列控制按鈕 
*/ 
$('#table1').bootstrapTable({ 
 columns: [ 
 { field: 'sno', title: '學(xué)生編號' }, 
 { field: 'sname', title: '學(xué)生姓名' }, 
 { field: 'ssex', title: '性別' }, 
 { field: 'sbirthday', title: '生日' }, 
 { field: 'class', title: '課程編號' }, 
 ], 
 url:'@Url.Action("GetStudent","DataOne")' 
}); 
<table id="table1" 
 data-classes="table table-hover " 
 data-search="true" 
 data-show-refresh="true" 
 data-show-toggle="true" 
 data-show-columns="true"></table> 

二、擴(kuò)展工具欄使用

/* 
* data-toolbar 用于指定id的div擴(kuò)展工具欄,這種方式類似EaseUI中的datagird 
* queryParams 請求服務(wù)器數(shù)據(jù)時(shí),你可以通過重寫參數(shù)的方式添加一些額外的參數(shù),例如 toolbar 中的參數(shù) 如果 queryParamsType = 'limit' ,返回參數(shù)必須包含 
  limit, offset, search, sort, order 否則, 需要包含: 
  pageSize, pageNumber, searchText, sortName, sortOrder. 
  返回false將會終止請求 
*/ 
var $table1= $('#table1').bootstrapTable({ 
 columns: [ 
 { field: 'sno', title: '學(xué)生編號' }, 
 { field: 'sname', title: '學(xué)生姓名' }, 
 { field: 'ssex', title: '性別' }, 
 { field: 'sbirthday', title: '生日' }, 
 { field: 'class', title: '課程編號' }, 
 ], 
 url: '@Url.Action("GetStudent","DataOne")', 
 queryParams: function (params) { 
 params.name = '張三豐'; 
 //特別說明,返回的參數(shù)的值為空,則當(dāng)前參數(shù)不會發(fā)送到服務(wù)器端 
 params.sex = $('input[name="sex"]:checked').val(); 
 return params; 
 } 
}); 
//刷新方法 
$('#heartBtn').click(function () { 
 ////刷新處理,指定query 的參數(shù),注:此地方指定的參數(shù),僅在當(dāng)次刷新時(shí)使用 
 //$table1.bootstrapTable('refresh', { 
 // query: { 
 // name: '張三' 
 // } 
 //}); 
 $table1.bootstrapTable('refresh'); 
}); 
<table id="table1" 
 data-classes="table table-hover " 
 data-search="true" 
 data-show-refresh="true" 
 data-show-toggle="true" 
 data-show-columns="true" 
 data-toolbar="#toolbar"></table> 
<div id="toolbar"> 
 <div class="btn-group"> 
 <button class="btn btn-default"> 
  <i class="glyphicon glyphicon-plus"></i> 
 </button> 
 <button class="btn btn-default"> 
  <i class="glyphicon glyphicon-heart" id="heartBtn"></i> 
 </button> 
 <button class="btn btn-default"> 
  <i class="glyphicon glyphicon-trash"></i> 
 </button> 
 </div> 
 <div class="form-group"> 
 <label class="control-label">性別:</label> 
 <label class="radio-inline"> 
  <input type="radio" name="sex" value="男" /> 男 
 </label> 
 <label class="radio-inline"> 
  <input type="radio" name="sex" value="女" /> 女 
 </label> 
 </div> 
</div> 

以上所述是小編給大家介紹的Bootstrap Table使用整理(四)之工具欄,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Javascript基礎(chǔ)知識盲點(diǎn)總結(jié)之函數(shù)

    Javascript基礎(chǔ)知識盲點(diǎn)總結(jié)之函數(shù)

    函數(shù)是由事件驅(qū)動的或者當(dāng)它被調(diào)用時(shí)執(zhí)行的可重復(fù)使用的代碼塊。這篇文章主要介紹了Javascript基礎(chǔ)知識盲點(diǎn)總結(jié)之函數(shù)的相關(guān)資料
    2016-05-05
  • IE與FF下javascript獲取網(wǎng)頁及窗口大小的區(qū)別詳解

    IE與FF下javascript獲取網(wǎng)頁及窗口大小的區(qū)別詳解

    本篇文章主要是對IE與FF下javascript獲取網(wǎng)頁及窗口大小的區(qū)別進(jìn)行了詳細(xì)的介紹,需要的朋友可以過來參考下,希望對大家有所幫助
    2014-01-01
  • js判斷瀏覽器類型為ie6時(shí)不執(zhí)行

    js判斷瀏覽器類型為ie6時(shí)不執(zhí)行

    這篇文章主要介紹了js怎么判斷瀏覽器類型,當(dāng)類型為ie6時(shí)如何不執(zhí)行,需要的朋友可以參考下
    2014-06-06
  • 微信小程序組件化開發(fā)的示例介紹

    微信小程序組件化開發(fā)的示例介紹

    雖然小程序在剛推出時(shí)是不支持組件化的,但如今小程序開始支持自定義組件開發(fā),下面這篇文章主要給大家介紹了關(guān)于微信小程序組件化開發(fā)的相關(guān)資料,需要的朋友可以參考下
    2023-03-03
  • 最新評論