api method to show datatables empty message

api method to show datatables empty message

pmengopmengo Posts: 74Questions: 37Answers: 2
edited July 2016 in DataTables 1.10

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.

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    The empty message should be shown automatically. I'm afraid I don't quite understand the goal here. Could you possibly clarify?

    Allan

This discussion has been closed.