Pagination Not Appearing in Table

Pagination Not Appearing in Table

lexisslexiss Posts: 3Questions: 0Answers: 0
edited December 2011 in DataTables 1.8
Hi, sorry if this have been addressed.

I have managed to make the basic function working in my table (a table that display row by row data from MySQL database), the search and filter is working fine but one thing that troubling me is that the default pagination button does not appear at the bottom of my tables. I wonder why. Here's my coding,

[code]
<?php
include_once('includes/header.php');
include_once('includes/connect.php');
?>



@import "css/demo_page.css";
@import "css/demo_table.css";




$(document).ready( function() {
$('#test').dataTable( {
"iDisplayLength": 50
} );
} )




IRRADIATING APPARATUS LISTING

<!-- Functional Buttons -->















<!-- Table Header -->
APPARATUS BRAND
MODEL
DETAILS


<?php
$query = "SELECT id, brand, model FROM ir_apparatus ORDER BY brand, model ASC" ;
$result = @mysql_query($query);

// Print result
$bg="even gradeC";

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$bg = ($bg=='odd GradeA' ? 'even gradeC' : 'odd GradeA'); // switch background color

echo "
$row[brand]
$row[model]
view
" ;
}
?>




[/code]

I have tried my very best to ensure my coding has met the requirement (proper table tagging, initialization to use DataTable) but still cant find what's my mistake is. Any helps will be appreciated, thanks!!

Replies

  • d_vineetd_vineet Posts: 19Questions: 0Answers: 0
    edited December 2011
    I am using datatables like this--

    [CODE]

    $(document).ready(function() {
    $('#leavetp_table').dataTable( {
    "bJQueryUI": true,
    "bPaginate": true,
    'sPaginationType': 'full_numbers',
    "bProcessing": true,
    "bServerSide": true,
    "aaSorting": [[ 1, "desc" ]],
    "bAutoWidth": false,
    "aoColumns" : [
    { sWidth: '42px' },
    { sWidth: '253px' },
    { sWidth: '100px' },
    { sWidth: '80px' },
    { sWidth: '80px' },
    { sWidth: '76px' }
    ],
    "sAjaxSource": "server-side url name goes here",
    } );
    } );
    jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages = 10;

    [/CODE]

    In the server-side function--

    return these variables -->> sEcho, iTotalRecords, iTotalDisplayRecords, iDisplayLength, aaData
    I have my code in Python.
    If you are interested I can post my code.
    HTH.

    -- Vineet
  • lexisslexiss Posts: 3Questions: 0Answers: 0
    Are you saying that I should declare the pagination settings in the initialization ?? But I thought pagination is turned on by default ??
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Paging is enabled by default. My guess is that the image paths are wrong for the two images that show the paging controls. Are you getting any 404 errors in your server error log. The Inspector in Chrome/Safari would should that as well.

    Allan
  • lexisslexiss Posts: 3Questions: 0Answers: 0
    That's very perceptive of you Allan. The function is there always just that the images aint there, cant believe I never thought of it's caused by broken link. Thanks you very much.
This discussion has been closed.