The Bootstrap Table cannot load data quickly.
Bootstrap-table is a powerful table plug-in based on Bootstrap style, Official Website: http://bootstrap-table.wenzhixin.net.cn/zh-cn/
The following is a small problem: the Bootstrap Table cannot load data.
$("#button").click(function(){ var name=$("input[name='name']").val(); $('#table').bootstrapTable('load',"../Query/FindMoonByName?name="+name); });
I use the json data returned from the remote address as the data. It's okay, but it's an error.
Solution:
Convert the stored json data into an object.
$ ("# Button "). click (function () {var name = $ ("input [name = 'name']"). val (); $. ajax ({type: "POST", url :".. /Query/FindMoonByName? Name = "+ name, success: function (msg) {// msg is a json object, not a json string. $ ('# Table'). bootstrapTable ('load', msg );}});});
If you set the returned Response Message Content-Type to application/json; charset = UTF-8, the returned msg is the json object.
Then you can load it directly.
If you set the returned Response Message Content-Type to text/html; charset = UTF-8, the returned msg is a json string.
Then you need to convert JSON. stringify (string) into an object and then load it.
Test:
Bootstrap-table.js version: 1.11.1
Bootstrap. js v3.3.0
The above is a quick solution that the Bootstrap Table has been loaded (load) and cannot load data. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner, and I would like to thank you for your support for the help House website!