Skip to content

Commit

Permalink
Example - update: Use $ and fnUpdate in the index column example - 9840
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Jardine committed May 10, 2012
1 parent b64dda4 commit 90edd0b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/api/counter_column.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
$(document).ready(function() { $(document).ready(function() {
$('#example').dataTable( { $('#example').dataTable( {
"fnDrawCallback": function ( oSettings ) { "fnDrawCallback": function ( oSettings ) {
var that = this;

/* Need to redo the counters if filtered or sorted */ /* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered ) if ( oSettings.bSorted || oSettings.bFiltered )
{ {
for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ ) this.$('td:first-child', {"filter":"applied"}).each( function (i) {
{ that.fnUpdate( i+1, this.parentNode, 0, false, false );
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 ); } );
}
} }
}, },
"aoColumnDefs": [ "aoColumnDefs": [
Expand Down Expand Up @@ -539,10 +540,9 @@ <h1>Initialisation code</h1>
/* Need to redo the counters if filtered or sorted */ /* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered ) if ( oSettings.bSorted || oSettings.bFiltered )
{ {
for ( var i=0, iLen=oSettings.aiDisplay.length ; i&lt;iLen ; i++ ) this.$('td:first-child', {"filter":"applied"}).each( function (i) {
{ that.fnUpdate( i+1, this.parentNode, 0, false, false );
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 ); } );
}
} }
}, },
"aoColumnDefs": [ "aoColumnDefs": [
Expand Down

0 comments on commit 90edd0b

Please sign in to comment.