server side No click on pagination two-button

server side No click on pagination two-button

gutzoftergutzofter Posts: 58Questions: 0Answers: 0
edited April 2010 in General
No next click event added in server side. Using firebug and running in console
[code]
$(document).ready(function() {
oTable = $('#sku_table').dataTable();
oTable.fnPageChange( 'next' );
} );
[/code]

Error from firebug console is: TypeError: oSettings is null { message="oSettings is null", more...}


The table is generated here:
[code]



<?php
require_once dirname(__FILE__) . '/../../contexts/SessionContext.php';

function hasSessionVariableFor($item) {
return array_key_exists($item, $_SESSION);
}

if(hasSessionVariableFor('DB')) {

$context = new SessionContext();

$vendor = $_SESSION['DB'];

$headerNames = $context->executeHeaderNames($vendor);

$table = <<< TABLE_START




TABLE_START;

foreach($headerNames as $name) {
$table .= <<< TABLE_HEADERS
$name
TABLE_HEADERS;
}
$table .= <<< TABLE_MIDDLE




Loading data from server...




TABLE_MIDDLE;
foreach($headerNames as $name) {
$table .= <<< TABLE_HEADERS
$name
TABLE_HEADERS;
}

$table .= <<< TABLE_END







TABLE_END;

echo $table;

}
?>



$(document).ready(function() {
$('#sku_tbl').dataTable({
bProcessing: true,
bServerSide: true,
sAjaxSource: "includes/SkuTable.php"});
});


[/code]

I am not having any problems with search or sorting any columns of table.

Server is working fine

Replies

  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    edited April 2010
    Here is the Json:
    [code]
    {
    "sEcho": 1,
    "iTotalRecords": 372,
    "iTotalDisplayRecords": 0,
    "aaData": [
    "proprietary data"
    ]
    }
    [/code]

    I think it might be with `iTotalDisplayRecords` being zero.

    Am I correct?
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    I simulated a Json echo from the server:

    [code]
    {
    "sEcho": 1,
    "iTotalRecords": 372,
    "iTotalDisplayRecords": 372,
    "aaData": [
    "proprietary data"
    ]
    }
    [/code]

    Next now sends get request to server cool!
    Need to really read the FAQ. Thats where I got the hint.
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    edited April 2010
    Fixed it. In PHP 5.3.0 cannot really do a SQL: [code]FOUND_ROWS()[/code]

    Went ahead and ran the select without limits to get [code]iTotalDisplayRecords[/code].

    Works great now!
This discussion has been closed.