cant get data form the array in the right row of the table
cant get data form the array in the right row of the table
dewilde
Posts: 9Questions: 0Answers: 0
I have an array with data and i want to get the data in different columns.
Below is my setup in Datatables live (it doesnt work)
http://live.datatables.net/vijusad/4/edit
So my question is how do i get the data in different columns of the table.
This discussion has been closed.
Replies
You'll only get two columns of data that way, but I presume that is what you want? It looks like the correct approach to me. Are you able to link me to a live test page that actually shows it in the error state?
Allan
I have three columms and i want to get the url (example.com) in the same table as the other data.
I am afraid i can't give you a test page, the website is an internal website for my company.
I kinda fixed it, i have the data from the array in the correct row of the tables
The only thing i want now is that the url comes in one of the table rows aswell
So you want one of the columns generated by DataTables? You need to use
columns.data
to tell it to do that.Allan
Yes i have already done that with
But now i want url (example.com) in the second column. Below is my array and datatable code.
Array:
Datatable
Use
columns.render
as a function. You could usecolumns.data
, but you'll find it much easier withcolumns.render
. There are examples in the documentation.Allan
Thank you! Its fixed :)
I have another question about this.
I have multiple datatables and a large array file with data.
How do i get test_data do be different? so in every datatable is different data
I'm afraid I don't understand the question - are you making 3 ajax requests to different addresses, or just one and it contains three sources. If so, you'd be best off making a single Ajax call yourself and then using
data
to populate all three tables.Allan
Well let me explain it more with my array and datatable, you can see it both below.
This is the different data i have in a array. I have multiple datatables and i want all the data of the array displayed in the different datatables.