$(window).load(function () {
$('#managertable').dataTable({
"bServerSide": true,
"bAutoWidth": true,
"bStateSave": false, //保存状态到cookie ******很重要 , 当搜索的时候页面一刷新会导致搜索的消失。使用这个属性设置为true就可避免了
"bPaginate": true, // 是否使用分页
"bProcessing": true, //是否显示正在处理的提示
"bLengthChange": false, //是否启用设置每页显示记录数
"iDisplayLength": 20, //默认每页显示的记录数
"bFilter": true, //是否使用搜索
"bJQueryUI": true, //页面风格使用jQuery.
// "sScrollY": 200,//竖向滚动条 tbody区域的高度
"sScrollX": "100%", //横向滚动条
"sScrollXInner": "100%",
"bScrollCollapse": true,
"aoColumns": [{ "sTitle": "Id" },
{ "sTitle": "Name" },
{ "sTitle": "Permission" },
{ "sTitle": "Remarks"}],
"sPaginationType": "full_numbers", //分页样式
"bAutoWidth": true, //列的宽度会根据table的宽度自适应
"bSort": false, //是否使用排序
"aaSorting": [[0, "desc"]],
"sAjaxSource": "/action/admin/index.ashx?paraname=admingroupmanager&sub_detail_id=" + $.cookies.get('sub_detail_id')
});
});
下面是ajaxsource响应:
[{"Id":1,"Name":"管理员组","Permission":"100,110,120,130,200,210,220,300,310,320,330,400,410,420,430,500,510,520,600,610,620,630,631,632,633,634,640,700,710,720,730,740,800,810,820,830","Remarks":""}]
绑定不上:var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json ); //这里的json是有响应的数据
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
这里aData获取到的是:undefined; 这里解决了,
现在出现这个问题:
Showing 1 to NaN of NaN entries (filtered from NaN total entries)
DataTables warning (table id = 'managertable'): Requested unknown parameter '0' from the data source for row 0