Bootstrap Table使用整理(四)之工具欄
相關(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使用整理(五)之分頁(yè)組合查詢 http://www.dbjr.com.cn/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í),你可以通過(guò)重寫(xiě)參數(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ì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Bootstrap Table使用整理(三)
- Bootstrap Table使用整理(二)
- Bootstrap Table使用整理(一)
- Bootstrap Table使用整理(五)之分頁(yè)組合查詢
- BootstrapTable refresh 方法使用實(shí)例簡(jiǎn)單介紹
- Bootstrap table使用方法詳細(xì)介紹
- 值得分享的Bootstrap Table使用教程
- DataTables+BootStrap組合使用Ajax來(lái)獲取數(shù)據(jù)并且動(dòng)態(tài)加載dom的方法(排序,過(guò)濾,分頁(yè)等)
- BootStrap table使用方法分析
相關(guān)文章
詳解JavaScript中?.、??和??=的用法及使用場(chǎng)景
這篇文章主要為大家詳細(xì)介紹了JavaScript中?.、??和??=的用法及使用場(chǎng)景,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2023-08-08layui.tree組件的使用以及搜索節(jié)點(diǎn)功能的實(shí)現(xiàn)
今天小編就為大家分享一篇layui.tree組件的使用以及搜索節(jié)點(diǎn)功能的實(shí)現(xiàn),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09簡(jiǎn)單實(shí)現(xiàn)bootstrap選項(xiàng)卡效果
這篇文章主要為大家詳細(xì)介紹了如何簡(jiǎn)單實(shí)現(xiàn)bootstrap選項(xiàng)卡效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-02-02Jquery調(diào)用iframe父頁(yè)面中的元素及方法
對(duì)于javascript操作iframe父級(jí)頁(yè)面元素的方法,大家應(yīng)該都非常清楚了,下面結(jié)合當(dāng)前非常流行的jquery分享一下如何使用jquery查找和操作iframe父級(jí)頁(yè)面元素的實(shí)現(xiàn)代碼。2016-08-08JavaScript面向?qū)ο缶帉?xiě)購(gòu)物車功能
這篇文章主要為大家詳細(xì)介紹了JavaScript面向?qū)ο缶帉?xiě)購(gòu)物車功能的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-08-08Javascript基礎(chǔ)知識(shí)盲點(diǎn)總結(jié)之函數(shù)
函數(shù)是由事件驅(qū)動(dòng)的或者當(dāng)它被調(diào)用時(shí)執(zhí)行的可重復(fù)使用的代碼塊。這篇文章主要介紹了Javascript基礎(chǔ)知識(shí)盲點(diǎn)總結(jié)之函數(shù)的相關(guān)資料2016-05-05IE與FF下javascript獲取網(wǎng)頁(yè)及窗口大小的區(qū)別詳解
本篇文章主要是對(duì)IE與FF下javascript獲取網(wǎng)頁(yè)及窗口大小的區(qū)別進(jìn)行了詳細(xì)的介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-01-01