1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-19 17:54:14 +01:00

Fix - example: Server-side processing child rows example would throw a JS error if you click on the child row

This commit is contained in:
Allan Jardine 2015-04-03 10:52:24 +01:00
parent 220ae99e08
commit e7760542e0
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
ab58e914ab0fb157ed2efd6edb1cff5c2b7f5bee
605d941151924eed1f404fde499b05cc9671f1f8

View File

@ -56,7 +56,7 @@ $(document).ready(function() {
// Array to track the ids of the details displayed rows
var detailRows = [];
$('#example tbody').on( 'click', 'tr td:first-child', function () {
$('#example tbody').on( 'click', 'tr td.details-control', function () {
var tr = $(this).closest('tr');
var row = dt.row( tr );
var idx = $.inArray( tr.attr('id'), detailRows );
@ -82,7 +82,7 @@ $(document).ready(function() {
// On each draw, loop over the `detailRows` array and show any child rows
dt.on( 'draw', function () {
$.each( detailRows, function ( i, id ) {
$('#'+id+' td:first-child').trigger( 'click' );
$('#'+id+' td.details-control').trigger( 'click' );
} );
} );
} );
@ -177,7 +177,7 @@ $(document).ready(function() {
// Array to track the ids of the details displayed rows
var detailRows = [];
$('#example tbody').on( 'click', 'tr td:first-child', function () {
$('#example tbody').on( 'click', 'tr td.details-control', function () {
var tr = $(this).closest('tr');
var row = dt.row( tr );
var idx = $.inArray( tr.attr('id'), detailRows );
@ -203,7 +203,7 @@ $(document).ready(function() {
// On each draw, loop over the `detailRows` array and show any child rows
dt.on( 'draw', function () {
$.each( detailRows, function ( i, id ) {
$('#'+id+' td:first-child').trigger( 'click' );
$('#'+id+' td.details-control').trigger( 'click' );
} );
} );
} );</code>