这是一个基本的数据表小提琴。 这是默认和下拉菜单将显示follwoing Show options 10, 25, 50, 75 and 100 records:
现在我想获得工作是"lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
我可以在这个小提琴 。 但如果我使用服务器端的处理,这是在All
选项不会为我工作。 其他人做。 当我选择All
它dispalys它被显示数据和在底部说, No data found in the server
据我所知,唯一的区别是数据来自服务器。 任何人都可以告诉我怎么能麻烦拍出这样? 至于当我选择我可以告诉All
我送length:-1
和10
是length:10
所以不知道为什么All
不工作
$(document).ready(function() {
var dataTable = $('#employee-grid').DataTable( {
"lengthMenu" : [[ 10, 25, 50, -1 ],[ '10', '25', '50', 'All' ]],
//"pageLength": 25,
"processing": true,
"serverSide": true,
"ajax":{
url :"employee-grid-data.php", // json datasource
type: "post", // method , by default get
error: function(){ // error handling
$(".employee-grid-error").html("");
$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#employee-grid_processing").css("display","none");
}
}
} );
} );