iDisplayLength issue

iDisplayLength issue

12Bo12Bo Posts: 10Questions: 0Answers: 0
edited November 2011 in General
I am trying to change the default number of records that show up but no matter what value I set in the iDisplayLength the table only shows 10 records at a time.

Any thoughts on why this is happening?

[code] $('#walkthrough-table').dataTable({
"bPaginate": true,
"bFilter": true,
"bSort": true,
"bAutoWidth": false,
"sDom": '<"top"f<"advanced-search-wrap">>t<"bottom"lip>',
"iDisplayLength ": 50,
"aaSorting": [[ 6, "desc" ]],
'aoColumns' : [
{ 'sName': 'entry.publish_status', 'bSortable': false },
{ 'sName': 'entry.entry_id'},
{ 'sName': 'employee_name'},
{ 'sName': 'employee.first_name', 'bVisible': false },
{ 'sName': 'building.building_name'},
{ 'sName': 'entry.observed_by' },
{ 'sName': 'entry.date_submitted' },
{ 'sName': 'functions', 'bSortable': false },
],
"sAjaxSource": "<?php echo site_url('ajax/walkthrough/get_table_data'); ?>",
});
//Create the advanced search box w/ link
$('.advanced-search-wrap').html('Advanced Search');
[/code]

Replies

  • severinseverin Posts: 11Questions: 0Answers: 0
    you seem to have a trailing whitespace in the iDisplayLength - option. Perhaps that's the culprit?
  • 12Bo12Bo Posts: 10Questions: 0Answers: 0
    @severin,

    Thank you. I can't believe I overlooked that I need to take a nap.
  • avitolyopavitolyop Posts: 1Questions: 0Answers: 0
    I don't see how this helped you....but i still have the same problem....the table ALWAYS shows only 10 records at a time, and i always have to manually open the SHow combo box to modify it !?!?!
    here is my code
    [code]
    $(document).ready(function () {
    $('#dtfDATA').dataTable({
    "iDisplayLength": 50
    });
    });
    [/code]
    and i work with the latest version (1.9...)

    I tried with the script BEFORE and AFTER the table....NADA...same problem

    Thanks for ANY help
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Here is your code running live and it seems to work just fine for me: http://live.datatables.net/ejolez/edit . Can you give us a link to your page please?

    Allan
This discussion has been closed.