BootstrapTable refresh 方法使用實例簡單介紹
本文就bootstrapTable refresh 方法如何傳遞參數(shù)做簡單舉例說明。下面代碼中,一個table,一個button,單擊button會觸發(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ā)出的請求url為
“http://local/api/data/?format=json&type=1&level=2”
以上所述是小編給大家介紹的BootstrapTable refresh 方法使用實例簡單介紹,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
- Bootstrap table中toolbar新增條件查詢及refresh參數(shù)使用方法
- BootStrap Table后臺分頁時前臺刪除最后一頁所有數(shù)據(jù)refresh刷新后無數(shù)據(jù)問題
- Bootstrap的Refresh Icon也spin起來
- bootstrap select2插件用ajax來獲取和顯示數(shù)據(jù)的實例
- 使用vue框架 Ajax獲取數(shù)據(jù)列表并用BootStrap顯示出來
- Bootstrap進度條與AJAX后端數(shù)據(jù)傳遞結(jié)合使用實例詳解
- bootstrap jquery dataTable 異步ajax刷新表格數(shù)據(jù)的實現(xiàn)方法
- 使用Bootstrap Tabs選項卡Ajax加載數(shù)據(jù)實現(xiàn)
- DataTables+BootStrap組合使用Ajax來獲取數(shù)據(jù)并且動態(tài)加載dom的方法(排序,過濾,分頁等)
- bootstrapTable+ajax加載數(shù)據(jù) refresh更新數(shù)據(jù)
相關(guān)文章
細數(shù)promise與async/await的使用及區(qū)別說明
這篇文章主要介紹了細數(shù)promise與async/await的使用及區(qū)別說明,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-07-07
webpack4 optimization使用總結(jié)
這篇文章主要介紹了webpack4 optimization使用總結(jié),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-11-11
關(guān)于javascript中限定時間內(nèi)防止按鈕重復(fù)點擊的思路詳解
下面小編就為大家?guī)硪黄P(guān)于javascript中限定時間內(nèi)防止按鈕重復(fù)點擊的思路詳解。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-08-08
JavaScript實現(xiàn)淘寶網(wǎng)圖片的局部放大功能
這篇文章主要為大家詳細介紹了JavaScript實現(xiàn)淘寶網(wǎng)圖片的局部放大功能,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-05-05
JavaScript?中的單例內(nèi)置對象Global?與?Math
這篇文章主要介紹了JavaScript?中的單例內(nèi)置對象Global與Math,文章圍繞主題展開詳細的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下2022-07-07

