Skip to content

Commit b6e0683

Browse files
committed
Fix #69: Update more than one information element
1 parent 1c6150a commit b6e0683

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

js/dataTables.checkboxes.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -783,15 +783,6 @@
783783
return;
784784
}
785785

786-
var $output = $('<span class="select-info"/>');
787-
var add = function(name, num){
788-
$output.append( $('<span class="select-item"/>').append( dt.i18n(
789-
'select.'+name+'s',
790-
{ _: '%d '+name+'s selected', 0: '', 1: '1 '+name+' selected' },
791-
num
792-
) ) );
793-
};
794-
795786
// Get index of the first column that has checkbox and row selection enabled
796787
var colIdx = self.getSelectRowColIndex();
797788

@@ -805,12 +796,21 @@
805796
}
806797
}
807798

808-
add('row', countRows);
799+
var add = function($el, name, num){
800+
$el.append( $('<span class="select-item"/>').append( dt.i18n(
801+
'select.'+name+'s',
802+
{ _: '%d '+name+'s selected', 0: '', 1: '1 '+name+' selected' },
803+
num
804+
) ) );
805+
};
809806

810807
// Internal knowledge of DataTables to loop over all information elements
811808
$.each( ctx.aanFeatures.i, function ( i, el ) {
812809
var $el = $(el);
813810

811+
var $output = $('<span class="select-info"/>');
812+
add($output, 'row', countRows);
813+
814814
var $existing = $el.children('span.select-info');
815815
if($existing.length){
816816
$existing.remove();

0 commit comments

Comments
 (0)