2017-01-03 77 views
-1
// the function that has to be runned 
function _fnInitialise (settings) 
{ 
    ...... 
    _fnReDraw(settings); 
    ...... 
} 

// the holdPosition decide whether to keep _iDisplayStart 
function _fnReDraw(settings, holdPosition) 
{ 
    ...... 
    if (holdPosition !== true) { 
    settings._iDisplayStart = 0; 
    } 
    ...... 
} 

// so the displayStart or iDisplayStart of my options will be reset 



var __reload = function (settings, holdPosition, callback) 

HoldPosition是可以决定是否保持页面信息(displayStart和pageLength)重装时设置了一个param为什么jQuery的数据表重置displayStart。时,首先呈现

function _fnInitialise (settings) 

_fnInitalise将在第一次绘制表格时运行。页面信息将在这个函数中被重置,没有像__reload这样的参数。所以我不能设置默认的displayStart。

回答

0

“stateSave”可以解决我的问题。如果“stateSave”设置为true,displayStart会记住localStorage或sessionStorage。关键是Datatable_${tableId}_${url}。我可以获取Datatables之外的信息。