问题
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" />'
})
来源:https://stackoverflow.com/questions/37226074/how-should-i-set-loadingrecords-string-or-html-element-for-angular-datatables