Load Json data
See original GitHub issuevar newDta $.ajax({ url: “listRequest”, async: true, crossDomain: true, type: “post”, dataType: “json”, success: function (data) { var newDta = JSON.stringify(data);
$('#table').bootstrapTable({
classes: 'table table-responsive table-striped table-bordered',
undefinedText: '',
data:data.json,
iconsPrefix: 'fa',
showRefresh: false,
search: true,
pageSize: 10,
pagination: true,
sidePagination: 'client',
sortable: true,
cookie: true,
mobileResponsive: true,
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'txt','json','xml','excel','sql','pdf'],
maintainSelected: true,
paginationFirstText: "First",
paginationLastText: "Last",
paginationPreText: "Previous",
paginationNextText: "Next",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
refresh: 'fa-refresh'
},
columns: [
{field:'server_id'},
{field:'server_id'},
{field:'server_id'},
{field:'server_id'}
]
});
}});
Hello buddy ,
I am getting all json data into data variable, I want to put this data inside boottrap table. i tried lot and lot but fail everything so please help me as soon as possible
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Read JSON file using Python - GeeksforGeeks
It's pretty easy to load a JSON object in Python. Python has a built-in package called json, which can be used to work...
Read more >Working With JSON Data in Python
In the json library, you'll find load() and loads() for turning JSON encoded data into Python objects. Just like serialization, there is a...
Read more >Loading a JSON File in Python – How to Read and Parse JSON
How to Read JSON Files ... You pass the file path to the open method which opens the file and assigns the stream...
Read more >Python JSON: Read, Write, Parse JSON (With Examples)
You can use json.load() method to read a file containing JSON object. Suppose, you have a file named person.json which contains a JSON...
Read more >Python JSON - W3Schools
Python has a built-in package called json , which can be used to work with JSON data. Example. Import the json module: import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Close this issue because there is no any response in 7 days, if the problem exists reopen it and provide a jsFiddle, thanks!
@ChiragDhangar - look at the doco + examples and remove ‘is:closed’ filter then search here
http://bootstrap-table.wenzhixin.net.cn/getting-started/ http://bootstrap-table.wenzhixin.net.cn/documentation/#table-options (see ‘url’ and ‘responseHandler’ in particular) http://issues.wenzhixin.net.cn/bootstrap-table/ (examples) https://github.com/wenzhixin/bootstrap-table/issues?utf8=✓&q=is%3Aissue+json
And for fiddle links and guide to how you actually should ask for help: https://github.com/wenzhixin/bootstrap-table/blob/master/CONTRIBUTING.md#bug-reports
You look like you copy pasted code from 3 different places, not sure why you include it in ajax success (you can, but you certainly dont need to, see
url
option in examples and doco). You also got aJSON.stringify
call that looks like it will not only give you an error (Use https://developers.google.com/web/tools/chrome-devtools/?hl=en or similar F12 tool to see errors produced) but which you never use the return from for anything.Your columns all say ‘server_id’, no idea what thats about, but again just look at doco and examples
No idea what you data looks like, and ect ect ect
Take any of the examples or fiddles then
console.log
(see if it matches what you see inurl
option doco)url
,ajaxOptions
ordata
appropriatelyresponseHandler
if you cant affect the json enough to make it mirror exact structure.Look at the doco, follow the examples, search other issues