api method to show datatables empty message
api method to show datatables empty message
pmengo
Posts: 74Questions: 37Answers: 2
Is there a way to show the empty message , calling api method?
ex:
if (obj.tbl.data().count() == 0) {
$('#' + obj.tableId + ' .dataTables_empty').parent().show();
var el = $("#" + obj.tableId + "_wrapper > div:nth-child(2) > div > div > div.dataTables_scrollHead > div > table > thead > tr > th:last");
el.append("<button class='btn btn-xs btn-success tblCreateBut'><i class='fa fa-plus fa-xs'></i></button>");
}
for instance, instead of" $('#' + obj.tableId + ' .dataTables_empty').parent().show(); "
, use of obj.tbl.showEmptyMessage() ???
Thanks in advance
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
The empty message should be shown automatically. I'm afraid I don't quite understand the goal here. Could you possibly clarify?
Allan