Cannot list details data in jQuery Datatable

前端 未结 1 797
闹比i
闹比i 2020-12-11 13:58

I followed jQuery Datatable - Sliding child rows example (just look at \"Complete code\" section on that page) in my ASP.NET MVC project and I could listed master & stat

相关标签:
1条回答
  • 2020-12-11 14:30

    You need to show loading indicator in the child row, retrieve content via Ajax and inject it into the child row replacing loading indicator.

    For example:

    // ... skipped ...
    
    // Open this row
    row.child('<p><center>Loading...</center></p>', 'no-padding' ).show();
    tr.addClass('shown');
    $('div.slider', row.child()).slideDown();
    
    $.getJSON("GetStudents?id=" + id, function(data){
       $('td', row.child()).html(format(data));
       $('div.slider', row.child()).show();
    });
    
    // ... skipped ...
    

    See this example for code and demonstration.

    0 讨论(0)
提交回复
热议问题