How to display multiple child details under parent row in datatable

How to display multiple child details under parent row in datatable

AshvinAshvin Posts: 1Questions: 1Answers: 0

I want to to display data in datatable from MySql database.

Data should should display with multiple child rows under parent row.

Chris, please help me how to do this. As i saw this http://usatoday30.usatoday.com/sports/college/football/story/2011-11-17/cover-college-football-coaches-salaries-rise/51242232/1

I have same requirement as you had. I didn't find any solution in your blog.

Please Please help me.

Answers

  • nigel pasconigel pasco Posts: 37Questions: 6Answers: 0

    Was the link above sufficient for your solution, Ashvin?

    I too am trying to figure out Chris' solution. I can add extra row details as child rows, as per the link from tangerine; and I can add a datatable as the child row (even with some additional data).

    However, I am unable to figure how to do both in the same child (as Chris has done on his page).

    ie. combining both of these to drop down from the same parent:

                $('#table_user_history').DataTable( nestedtable );
                // Open this row
    
                row.child( $('<table/>')  ).show();
    
                tr.addClass('shown');
                row.child().find('table').DataTable(nestedtable);
    

    and...

                // Open this row
    
                row.child( format(row.data()), 'no-padding' ).show();
                tr.addClass('shown');
    
                $('div.slider', row.child()).slideDown();
    

    Any ideas? I will email Chris... his post was a while ago.

    cheers :P

  • allanallan Posts: 61,887Questions: 1Answers: 10,140 Site admin

    The USA Today page looks like it just uses a fairly complex HTML structure inside and HTML row / cell. Is that want you want to do? Or do you want multiple child rows under the main DataTable?

    Allan

  • nigel pasconigel pasco Posts: 37Questions: 6Answers: 0

    Ashvin,
    Chris has been kind enough to send me the html and js files behind the College Football page mentioned in your post. I can send it to you if you like.

    In the meantime, I will be using them to figure it out for use on my site - and will post my solution when done.
    Nige

This discussion has been closed.