English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article gives a simple example of how to pass parameters with the bootstrapTable refresh method. The following code demonstrates a table and a button, where clicking the button triggers the refresh operation of the table.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8">-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">Refresh</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>
The request URL for refresh is
"http://local/api/data/?format=json&type=1&level=2
The above is a simple introduction to the BootstrapTable refresh method introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave a message, and the editor will reply to everyone in time. I also want to express my sincere gratitude to everyone for their support of the Yell Tutorial website!
Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email for reporting, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)