2
我必须做错了什么,但我的代码是非常基本的,几乎没有偏离他们在网络上的例子。Datatables不处理页面更改
我使用服务器端分页,什么我遇到的是,在眼前的页面加载它在数据从服务器上拉和渲染表就好了。但是,分页或更改页面上的记录数量确实会导致AJAX调用,但无法真正处理。
如果我更改jquery.dataTables.js(v 1.8.2)的第3562行,问题就会消失。
if (false)//json.sEcho*1 < oSettings.iDraw)
有些情况下该行:
function _fnAjaxUpdateDraw (oSettings, json)
{
if (typeof json.sEcho != 'undefined')
{
/* Protect against old returns over-writing a new one. Possible when you get
* very fast interaction, and later queires are completed much faster
*/
if (false)//json.sEcho*1 < oSettings.iDraw)
只是为了证明我的设置是如何直接的方式是:
<script type="text/javascript">
$(function(){
$('#recTable').dataTable({
"bProcessing":true,
"bServerSide": true,
"sAjaxSource": "/recordings/partPageCallRecordings/",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "bSortable": false },
null,
null,
null,
{ "bSortable": false }
]
});
});
</script>
和HTML:
<table id='recTable' class='vmTable' >
<thead>
<tr class='vmHeader'>
<th><input id='selectAll' type='checkbox'></input></th>
<th class='sortHead'>Date</th>
<th class='sortHead'>File Name</th>
<th class='sortHead'>Type</th>
<th class='sortHead'>Playback</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
从我的经验与服务器上的数据进行交互的正确方法是从请求参数得到它,然后不修改它,并把它右中不变的响应回落。 –
完美的谢谢。我不知道我是如何忽略这一事实的,即我的硬件代码中有这部分内容。 – andyortlieb