multiple datatables with json data
multiple datatables with json data
bluebabe86
Posts: 3Questions: 0Answers: 0
Hi Allan ,
Is it possible to create 2 dataTables in the same page? I have 2 sets of json data , test1.json and test2.json. I want to create 2 dataTables from the 2 json sets. The code is something like this :
[code]
$.getJson(test1){
$('#dataTable1').datatable({
"aoColumns" : test1.columns;
"aaData" :test1.tabledata ;
});
}
$.getJson(test2){
$('#dataTable2').datatable({
"aoColumns" : test2.columns;
"aoColumns" :test2.tabledata ;
});
}
[/code]
This works if i want to display a single table, but throws exceptions for multiple tables. Am i doing something wrong ?
Thank you in advance :)
bluebabe86
Is it possible to create 2 dataTables in the same page? I have 2 sets of json data , test1.json and test2.json. I want to create 2 dataTables from the 2 json sets. The code is something like this :
[code]
$.getJson(test1){
$('#dataTable1').datatable({
"aoColumns" : test1.columns;
"aaData" :test1.tabledata ;
});
}
$.getJson(test2){
$('#dataTable2').datatable({
"aoColumns" : test2.columns;
"aoColumns" :test2.tabledata ;
});
}
[/code]
This works if i want to display a single table, but throws exceptions for multiple tables. Am i doing something wrong ?
Thank you in advance :)
bluebabe86
This discussion has been closed.