[转]bootstrapTable refresh 方法使用简单举例
生活随笔
收集整理的這篇文章主要介紹了
[转]bootstrapTable refresh 方法使用简单举例
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
原文地址:https://blog.csdn.net/lanyang123456/article/details/55805478
本文就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"> <link rel="stylesheet" href="../libs/bootstrap-table-v1.11.0/bootstrap-table.css"> <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”
總結(jié)
以上是生活随笔為你收集整理的[转]bootstrapTable refresh 方法使用简单举例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 再有人问你synchronized是什么
- 下一篇: Spark算子总结版