以下是代码:
var $oTable = $('#table').DataTable( {"bPaginate" : true}; );
The following piece of code returns the settings object"
$oTable.settings()[0]
现在,我需要知道设置对象的属性,它表示是否"分页"是真还是假。以下是在浏览器控制台中显示设置对象的图像:
答案 0 :(得分:0)
bPaginate bServerSide
答案 1 :(得分:0)
在jquery.dataTables.js 1.9.4上搜索我没有看到任何属性,我认为你必须做类似于这个版本的功能:
function _fnCalculateEnd( oSettings )
{
if ( oSettings.oFeatures.bPaginate === false )
{
oSettings._iDisplayEnd = oSettings.aiDisplay.length;
}
else
{
/* Set the end point of the display - based on how many elements there are
* still to display
*/
if ( oSettings._iDisplayStart + oSettings._iDisplayLength > oSettings.aiDisplay.length ||
oSettings._iDisplayLength == -1 )
{
oSettings._iDisplayEnd = oSettings.aiDisplay.length;
}
else
{
oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength;
}
}
}
所以你必须知道是否有分页看着 _iDisplayStart 和 _iDisplayLength (基础+偏移)和结果数组的长度 aiDisplay