Skip to content
Advertisement

Bootstrap-table: doesn’t work creating table from JavaScript

I’m creating a table from my index.js for the index.ejs to show some data from the database (SQL Server) but in the view the table doesn’t show any data or some error. The function from ‘api/pedidos’ does return me the query in JSON format.

I think the problem is in how a create the Table in index.js but i can’t recognize it.

This is the function from my api file:

JavaScript

And this is how i create the table in index.js:

JavaScript

And this is the view, doesn’t show any data and the browser console doesn’t show any errors:

enter image description here

Advertisement

Answer

I try with this example How to fill bootstrap table via bootstrapTable()? and it works for me using $(‘#table’).bootstrapTable({data: data});. I didn’t have the data parse to JSON because my data is already in JSON format.

Thanks to @Shmack for providing the solution.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement