数据表sInfo在表空时更改文本

chr*_*ris 4 javascript jquery datatables

好吧,我知道我可以改变文字一般这样说:

"oLanguage": {
                "sInfo": 'Showing _END_ Sources.',
                "sEmptyTable": "No Sources found currently, please add at least one.",
}
Run Code Online (Sandbox Code Playgroud)

sInfo属性更改默认行为,并正常工作.但是当表为空时,sInfo会更改为.

显示0个条目中的0到0

这不是我想要的,我想给我的sEmptyTable属性留一个类似的消息,但是特定于sInfo,当它没有到达任何行时,它不会改变它.我一直在阅读API,到目前为止我找不到任何参考,我想知道是否有其他人知道正确的方法.因为我能想到的唯一方法就是手动完成并在数据表API之外进行,我非常确定这会给我一些形式的其他冲突.

Jas*_*son 11

datatables还有oLanguage.sInfoEmpty,它可以满足您的需求.

http://datatables.net/ref

"oLanguage": {
    "sInfo": 'Showing _END_ Sources.',
    "sInfoEmpty": 'No entries to show',
    "sEmptyTable": "No Sources found currently, please add at least one.",
}
Run Code Online (Sandbox Code Playgroud)