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

BootstrapTable refresh 方法使用實例簡單介紹

 更新時間:2017年02月20日 09:08:48   作者:lanyang123456  
本文就bootstrapTable refresh 方法如何傳遞參數(shù)做簡單舉例說明,非常不錯,具有參考借鑒價值,需要的朋友參考下吧

本文就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 方法使用實例簡單介紹,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關文章

最新評論