merge 2 datalist to datatable
merge 2 datalist to datatable
joon49
Posts: 12Questions: 2Answers: 0
hello,
i have two databases with the same structure
and i want show the two data in an single datatable.
how can i proceed pls?
thanks in advance
Replies
There are lots of ways to do this. A couple options are:
rows.add()
for each data set to populate the tableKevin
can I have an example pls?
Here is one option using jQuery ajax() to fetch the two dat sets:
http://live.datatables.net/forazake/1/edit
The example uses the same URL and you will see duplicate data. You will use different URLs.
Kevin
how Merge the data together in your server script to return as one JSON response?
thanks in advance
You will need the row data in an array as described in the Data docs. If using
ajax
then the Ajax docs will have more useful information.How to combine the two data sets into one array is dependent on the server language you are using. You likely will be able to find suggestions on Stack Overflow for merging to arrays.
Kevin