BootstrapTable refresh 方法使用實(shí)例簡(jiǎn)單介紹
本文就bootstrapTable refresh 方法如何傳遞參數(shù)做簡(jiǎn)單舉例說(shuō)明。下面代碼中,一個(gè)table,一個(gè)button,單擊button會(huì)觸發(fā)刷新表格操作。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="../libs/bootstrap-table-v1.11.0/bootstrap.min.css" rel="external nofollow" > <link rel="stylesheet" href="../libs/bootstrap-table-v1.11.0/bootstrap-table.css" rel="external nofollow" > <script src="../libs/jQuery/jquery-1.8.3.min.js"></script> <script src="../libs/bootstrap-table-v1.11.0/bootstrap.min.js"></script> <script src="../libs/bootstrap-table-v1.11.0/bootstrap-table.js"></script> <script src="../libs/bootstrap-table-v1.11.0/bootstrap-table-zh-CN.js"></script> </head> <body> <table id="item_table"></table> <button id=refresh_button type="button">刷新</button> <script> $('#item_table').bootstrapTable({ columns: [{ field: 'id', title: 'Item ID' }, { field: 'name', title: 'Item Name' }, { field: 'price', title: 'Item Price' }], data: [{ id: 1, name: 'Item 1', price: '$1' }, { id: 2, name: 'Item 2', price: '$2' }] }); $("#refresh_button").click(function (){ var opt = { url: "http://local/api/data/?format=json", silent: true, query:{ type:1, level:2 } }; $("#item_table").bootstrapTable('refresh', opt); }); </script> </body> </html>
refresh發(fā)出的請(qǐng)求url為
“http://local/api/data/?format=json&type=1&level=2”
以上所述是小編給大家介紹的BootstrapTable refresh 方法使用實(shí)例簡(jiǎn)單介紹,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Bootstrap table中toolbar新增條件查詢及refresh參數(shù)使用方法
- BootStrap Table后臺(tái)分頁(yè)時(shí)前臺(tái)刪除最后一頁(yè)所有數(shù)據(jù)refresh刷新后無(wú)數(shù)據(jù)問(wèn)題
- Bootstrap的Refresh Icon也spin起來(lái)
- bootstrap select2插件用ajax來(lái)獲取和顯示數(shù)據(jù)的實(shí)例
- 使用vue框架 Ajax獲取數(shù)據(jù)列表并用BootStrap顯示出來(lái)
- Bootstrap進(jìn)度條與AJAX后端數(shù)據(jù)傳遞結(jié)合使用實(shí)例詳解
- bootstrap jquery dataTable 異步ajax刷新表格數(shù)據(jù)的實(shí)現(xiàn)方法
- 使用Bootstrap Tabs選項(xiàng)卡Ajax加載數(shù)據(jù)實(shí)現(xiàn)
- DataTables+BootStrap組合使用Ajax來(lái)獲取數(shù)據(jù)并且動(dòng)態(tài)加載dom的方法(排序,過(guò)濾,分頁(yè)等)
- bootstrapTable+ajax加載數(shù)據(jù) refresh更新數(shù)據(jù)
相關(guān)文章
JS實(shí)現(xiàn)動(dòng)態(tài)給圖片添加邊框的方法
這篇文章主要介紹了JS實(shí)現(xiàn)動(dòng)態(tài)給圖片添加邊框的方法,涉及javascript操作圖片border的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-04-04修改layui的后臺(tái)模板的左側(cè)導(dǎo)航欄可以伸縮的方法
今天小編就為大家分享一篇修改layui的后臺(tái)模板的左側(cè)導(dǎo)航欄可以伸縮的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09iframe調(diào)用父頁(yè)面函數(shù)示例詳解
這篇文章主要介紹了iframe如何調(diào)用父頁(yè)面函數(shù),下面有個(gè)不錯(cuò)的示例,大家可以參考下2014-07-07如何利用JavaScript獲取字符串中重復(fù)次數(shù)最多的字符
這篇文章主要給大家介紹了關(guān)于如何利用JavaScript獲取字符串中重復(fù)次數(shù)最多的字符的相關(guān)資料,文中介紹了兩種解決方案,分別是使用對(duì)象以及數(shù)組&指針來(lái)實(shí)現(xiàn),需要的朋友可以參考下2021-07-07js實(shí)現(xiàn)鼠標(biāo)移到鏈接文字彈出一個(gè)提示層的方法
這篇文章主要介紹了js實(shí)現(xiàn)鼠標(biāo)移到鏈接文字彈出一個(gè)提示層的方法,涉及javascript鼠標(biāo)事件與css樣式的相關(guān)技巧,需要的朋友可以參考下2015-05-05aspx中利用js實(shí)現(xiàn)確認(rèn)刪除代碼
在一些程序開(kāi)發(fā)中,對(duì)于刪除操作,最好再讓用戶確認(rèn)一下,以免誤操作,帶來(lái)的損失,下面的方法,大家可以參考下。各個(gè)語(yǔ)言下,都通用的思路。2010-07-07