How should I set loadingRecords string or HTML ele

2019-06-03 23:29发布

问题:

In native Datatables I set the loadingRecords like this:

var language = {
    "loadingRecords": '<img src="~/img/datatable_loading_bar.gif" />'
}

When loading data, it will show datatable_loading_bar.gif

But in angular-datatables, How can I achieve that?

回答1:

Use the withLanguage() method. You are not obligated to pass an entire language struct, simply pass just what you need to change :

.withLanguage({
   loadingRecords: '<img src="~/img/datatable_loading_bar.gif" />'
})