nir*_*ran 20 jquery jquery-plugins
我正在将jquery数据表集成到我的项目中.当调用service时,会抛出一些错误跟踪错误
无法读取未定义的属性'assorting'
这是代码
时间线
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.dataTables.js"></script>
Run Code Online (Sandbox Code Playgroud)
<body>
<script>
$(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "URL",
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
console.log(aoData);
oSettings.jqXHR = $.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
} );
} );
</script>
<div id="dvContent">
<table cellpadding="0" cellspacing="0" border="0" id="example">
</table>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
这是服务器的Sample out put
{"some":"yyy","open":null,"program":1,"more":"must","comment":000}
Bum*_*tle 36
你的桌子需要一个THEAD部分和一个TBODY部分:
<table cellpadding="0" cellspacing="0" border="0" id="example">
<thead><tr><th>First Column</th><th>Second Column etc.</th></tr></thead>
<tbody>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
注意:同样重要的是你的THEAD不能为空,因为dataTable要求你指定由指定的预期数据的列数.<tr><th></th></tr>
归档时间: |
|
查看次数: |
17678 次 |
最近记录: |