iDisplayLength

iDisplayLength

bigbrerbigbrer Posts: 2Questions: 0Answers: 0
edited January 2012 in General
Im using DataTables 1.8.2 with Scroller 1.0.1, when I instantiate datatable
$(document).ready(function() {
var oTable = $('#models').dataTable( {
'sScrollY':'300px',
'iDisplayLength':10,
'sAjaxSource':'<?= $ajaxSource ?>',
'bServerSide':true,
'bDeferRender':true,
'sDom':'frtiS'
} );
});

The iDisplayLength is always 3, whether I set it explicitly or not. I removed anywhite spaces.
But the value wont change.

The Request
http://localhost/projects/dbtest.com/wp-content/plugins/modelmanagement/ajax.php?action=Models&_=1326085488298&sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=3&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&mDataProp_5=5&mDataProp_6=6&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=true&sSearch_5=&bRegex_5=false&bSearchable_5=true&sSearch_6=&bRegex_6=false&bSearchable_6=true&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&bSortable_5=true&bSortable_6=true

Replies

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Is the table hidden (in a display:none) element when your initialise it? Scroller will override iDisplayLength with a value it things is suitable based on the height of the scrolling table - in this case it should be 300px, but I suspect it is failing to find the height.

    Allan
  • bigbrerbigbrer Posts: 2Questions: 0Answers: 0
    Turns out you cant use jquery 1.4.2 :) I plugged in jquery 1.7.1 with no problem. Thanks for your help man. Definitely making a donation to this project. Really good stuff.
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Ah! Damn - sorry. I did actually know that. There was a bug in jQuery whereby reading the height could do odd things. I think 1.5 fixed that. I'll add a dependency note to Scroller :-)

    Delighted you like DataTables!

    Regards,
    Allan
This discussion has been closed.