判断Datable是否有数据

采用any()方法

检查表格的数据是否为空

var table = $('#example').DataTable();
if ( ! table.data().any() ) {
    alert( 'Empty table' );
}

API链接:http://datatables.club/reference/api/any().html

posted @ 2018-12-07 11:52  y-xs  阅读(441)  评论(0编辑  收藏  举报