Hi Alan,
I have used your code to have drill down option. Instead of creating a div in the function fnFormatDetails, i need to create another data table dynamically. is it possible?
Thanks,
Anitha
I am using the drill down option and it works with my table, it's great. But I am trying to integrate a dataTable inside the dataTable... So basically, inside the outer dataTable, I click on the + button, to slide down the inner content, and inside the inner content is another dataTable.
so I know it's complicated, but is it possible?
I've been trying for hours to no avail.
Here's the test site:
http://modernguild.com/sites/all/modules/guild/mg/jquery-datatable/course.php
And here's the code:
view-source:http://modernguild.com/sites/all/modules/guild/mg/jquery-datatable/course.php
I got this working with data coming from a database. And I got it to work so there is a DataTable inside a DataTable. What I would like to know is how do I update the table information for a field I would normally calculate? For instance....I am displaying a list of programs and each program can have projects associated with it. My first DataTable shows a list of the programs, and then you can drill down to the projects. If I want to add on the program line the number of projects associated with the program, how would I add that? The number is not stored in the database. Before I got the DataTable working as you showed, I was able to call a function as I was creating the table but was doing that line by line. Can I somehow add a function to the ajax call for the field? (I added a field called prg_count thinking I could).
I wanted to add some more information....in order to get the the prg_count value, I need to use a field coming back in the ajax call (in the data.php). There is a field there that I am not displaying in the table that is used in the function that produces the prg_count value. Is there a way for me to use that field to call a function to set the column for each row? Not sure how to reference the field value that is in 'data'.
Replies
> "rowspan=2"
should be:
> rowspan="2"
And a closing is missing for the second row.
http://live.datatables.net/aXIr/3/edit
Allan
I have used your code to have drill down option. Instead of creating a div in the function fnFormatDetails, i need to create another data table dynamically. is it possible?
Thanks,
Anitha
@ Anitha - Sure - just put the table into the HTML and then initialise the new DataTAble.
Allan
I am using the drill down option and it works with my table, it's great. But I am trying to integrate a dataTable inside the dataTable... So basically, inside the outer dataTable, I click on the + button, to slide down the inner content, and inside the inner content is another dataTable.
so I know it's complicated, but is it possible?
I've been trying for hours to no avail.
Here's the test site:
http://modernguild.com/sites/all/modules/guild/mg/jquery-datatable/course.php
And here's the code:
view-source:http://modernguild.com/sites/all/modules/guild/mg/jquery-datatable/course.php
The code is too long to post here, sorry :(
Here is my ajax call:
$.ajax({
url:"data.php",
dataType:"json",
data:{
"action":"activePrograms"
},
success:function(data){
oTable = $('#example').dataTable( {
"bProcessing": true,
"aaData": data,
"aoColumns": [
{
"mData": null,
"sClass": "control center",
"sDefaultContent": ''
},
{ "mData": null,
"sName" : "prg_count"},
{ "mData": "prg_name" },
{ "mData": "market" },
{ "mData": "beta_date" },
{ "mData": "rtc_date" },
{ "mData": null,
"sName" : "prg_cpro"}
]
} );
}
} );
is possible that when I click on the row and the div appears, instead of a div appearing new rows making a ajax call??