Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

datatables sInfo changing text when table empty

Alright, I know I can change the text generally speaking as such:

"oLanguage": {
                "sInfo": 'Showing _END_ Sources.',
                "sEmptyTable": "No Sources found currently, please add at least one.",
}

the sInfo Property changes the default behavior, and works fine. However when the table is empty sInfo changes to.

Showing 0 to 0 of 0 entries

Which isn't desired, I'd like to have a similar message to my sEmptyTable property, but specific for sInfo, of which isn't the one its changing to when it reaches no rows. I have been reading through the API and I can't find any reference thus far for this, and I am wondering if anyone else know the correct way. Cause the only way I can think of is doing it manually and outside of the datatables API and Im pretty sure thats just going to give me some form of other conflict.

like image 251
chris Avatar asked Dec 20 '22 11:12

chris


1 Answers

datatables also has oLanguage.sInfoEmpty which will give you what you need.

http://datatables.net/ref

"oLanguage": {
    "sInfo": 'Showing _END_ Sources.',
    "sInfoEmpty": 'No entries to show',
    "sEmptyTable": "No Sources found currently, please add at least one.",
}
like image 121
Jason Avatar answered Dec 26 '22 19:12

Jason