国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

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

2019-11-19 16:22:52
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

相關(guān)閱讀:

Bootstrap Table使用整理(一) //m.survivalescaperooms.com/article/115789.htm

Bootstrap Table使用整理(二)  //m.survivalescaperooms.com/article/115791.htm

Bootstrap Table使用整理(三)  //m.survivalescaperooms.com/article/115795.htm

Bootstrap Table使用整理(五)之分頁(yè)組合查詢 //m.survivalescaperooms.com/article/115785.htm

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

/* * data-search 是否顯示搜索框 * data-show-refresh 是否像是刷新按鈕,注:刷新操作會(huì)重新請(qǐng)求數(shù)據(jù),并帶著請(qǐng)求參數(shù) * data-show-toggle 是否顯示面板切換按鈕 * data-show-columns 是否顯示列控制按鈕 */ $('#table1').bootstrapTable({  columns: [  { field: 'sno', title: '學(xué)生編號(hào)' },  { field: 'sname', title: '學(xué)生姓名' },  { field: 'ssex', title: '性別' },  { field: 'sbirthday', title: '生日' },  { field: 'class', title: '課程編號(hào)' },  ],  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 請(qǐng)求服務(wù)器數(shù)據(jù)時(shí),你可以通過重寫參數(shù)的方式添加一些額外的參數(shù),例如 toolbar 中的參數(shù) 如果 queryParamsType = 'limit' ,返回參數(shù)必須包含   limit, offset, search, sort, order 否則, 需要包含:   pageSize, pageNumber, searchText, sortName, sortOrder.   返回false將會(huì)終止請(qǐng)求 */ var $table1= $('#table1').bootstrapTable({  columns: [  { field: 'sno', title: '學(xué)生編號(hào)' },  { field: 'sname', title: '學(xué)生姓名' },  { field: 'ssex', title: '性別' },  { field: 'sbirthday', title: '生日' },  { field: 'class', title: '課程編號(hào)' },  ],  url: '@Url.Action("GetStudent","DataOne")',  queryParams: function (params) {  params.name = '張三豐';  //特別說(shuō)明,返回的參數(shù)的值為空,則當(dāng)前參數(shù)不會(huì)發(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使用整理(四)之工具欄,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 河南省| 当雄县| 洛阳市| 武乡县| 巴东县| 鄂伦春自治旗| 天等县| 彭阳县| 云霄县| 龙山县| 宁明县| 沅陵县| 夏河县| 宁明县| 承德市| 云龙县| 宜昌市| 鞍山市| 达州市| 如东县| 水城县| 屏东市| 东宁县| 泰和县| 宣威市| 大同市| 江都市| 湖北省| 万州区| 碌曲县| 县级市| 贵阳市| 西安市| 昂仁县| 齐河县| 方正县| 金阳县| 奉节县| 关岭| 南昌市| 安多县|