Skip to content

Commit

Permalink
Use sInfoEmpty if iTotal==0 (#258)
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge R. Herskovic <[email protected]>
  • Loading branch information
jherskovic and jrherskovic-mda authored Dec 28, 2023
1 parent 4679e62 commit 567ad06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions datatableview/static/js/datatableview.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ var datatableview = (function(){
"pageLength": datatable.attr('data-page-length'),
"infoCallback": function(oSettings, iStart, iEnd, iMax, iTotal, sPre){
$("#" + datatable.attr('data-result-counter-id')).html(parseInt(iTotal).toLocaleString());
var infoString = oSettings.oLanguage.sInfo.replace('_START_',iStart).replace('_END_',iEnd).replace('_TOTAL_',iTotal);
if (iMax != iTotal) {
infoString += oSettings.oLanguage.sInfoFiltered.replace('_MAX_',iMax);
var infoString;
if (iTotal == 0) {
infoString = oSettings.oLanguage.sInfoEmpty.replace('_START_',iStart).replace('_END_',iEnd).replace('_TOTAL_',iTotal);
}
else {
infoString = oSettings.oLanguage.sInfo.replace('_START_',iStart).replace('_END_',iEnd).replace('_TOTAL_',iTotal);
if (iMax != iTotal) {
infoString += oSettings.oLanguage.sInfoFiltered.replace('_MAX_',iMax);
}
}

return infoString;
}
});
Expand Down
2 changes: 1 addition & 1 deletion datatableview/static/js/datatableview.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 567ad06

Please sign in to comment.