没有数据时隐藏jquery datatable分页按钮
如何在没有数据时隐藏jquery datatable分页按钮并显示自定义消息添加要检查的代码没有数据时隐藏jquery datatable分页按钮,jquery,datatable,pagination,Jquery,Datatable,Pagination,如何在没有数据时隐藏jquery datatable分页按钮并显示自定义消息添加要检查的代码 if(num of records >0) { // show pagination } else { // no records message } 试试下面的代码。这对我有用。将此代码保存在datatables代码中 jQuery('#table_id').DataTable( { // Some stuff here "fnDrawC
if(num of records >0)
{
// show pagination
}
else
{
// no records message
}
试试下面的代码。这对我有用。将此代码保存在datatables代码中
jQuery('#table_id').DataTable( {
// Some stuff here
"fnDrawCallback":function(){
if(jQuery('table#table_id td').hasClass('dataTables_empty')){
jQuery('div.dataTables_paginate.paging_full_numbers').hide();
} else {
jQuery('div.dataTables_paginate.paging_full_numbers').show();
}
}
});
您是否忘记在问题中添加服务器端脚本语言标记?在jsp中的何处检查条件?我想在jsp中chk,如果length=0,则显示自定义消息,否则显示datatable。你能具体说明一下吗