Conditional Formatting within oLanguage > sInfo?
Conditional Formatting within oLanguage > sInfo?
I am making some small tweaks to a DataTable entry, and came across this small problem - if the _TOTAL_ is anything other than one, it makes sense, but if my number of records just so happens to be one, the phrase just doesn't make sense - "There are 1 people in this Role"?
Is there any way to change sInfo if _TOTAL_ is 1?
[code]
$("#sqepMatrix").dataTable({
"bJQueryUI": true,
"bPaginate": false,
"oLanguage": {
"sInfo": "There are _TOTAL_ people in this Role."
},
"sPaginationType": "full_numbers"
});[/code]
Any ideas are very welcome!
Felix
Is there any way to change sInfo if _TOTAL_ is 1?
[code]
$("#sqepMatrix").dataTable({
"bJQueryUI": true,
"bPaginate": false,
"oLanguage": {
"sInfo": "There are _TOTAL_ people in this Role."
},
"sPaginationType": "full_numbers"
});[/code]
Any ideas are very welcome!
Felix
This discussion has been closed.
Replies
I do need to add plural support to the core at some point... Bookmarked to remind me.
Allan
[code]
$("#sqepMatrix").dataTable({
"bJQueryUI": true,
"bPaginate": false,
"sPaginationType": "full_numbers",
"fnInfoCallback": function (oSettings, iTotal) {
if (iTotal == 1) {
return "There is one person in this Role.";
}
else {
return "There are " + iTotal + " people in the Role.";
}
}
});
[/code]
Allan