Not able to use pagination

Not able to use pagination

abhi12363abhi12363 Posts: 6Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
Hi All,

Please Help am in serious trouble , I am using datatables first time and m stuck on pagination stuff when ever i enable pagination my page throws error , After some R&D i found that there are some variables used in pagination were undefined in jquery.datatable.min.js .. Please HELP



dataTables setting Code













@import "CSS/pro_dropdown_2.css";
@import "CSS/dash_board.css";




function tData(){
var data={"iTotalDisplayRecords":50,"iTotalRecords":50,"aoColumns":[{"sTitle":"Company name","sWidth":"25%"},{"sTitle":"Address","sWidth":"25%","sClass":"center"},{"sTitle":"Town","sWidth":"25%"}],"aaData":[["Emkay Entertainments","Nobel House, Regent Centre","Lothian"],["The Empire","Milton Keynes Leisure Plaza","Buckinghamshire"],["Asadul Ltd","Hophouse","Essex"],["Gargamel ltd","",""],["Ashley Mark Publishing Company","1-2 Vance Court","Tyne \u0026 Wear"],["MuchMoreMusic Studios","Unit 29","London"],["Victoria Music Ltd","Unit 215","London"],["Abacus Agent","Regent Street","London"],["Atomic","133 Longacre","London"],["Pyramid Posters","The Works","Leicester"],["Kingston Smith Financial Services Ltd","105 St Peter\u0027s Street","Herts"],["Garrett Axford PR","Harbour House","West Sussex"],["Derek Boulton Management","76 Carlisle Mansions","London"]],"sEcho":"1"};
return (data);
}

$(document).ready( function () {

var table=tData() ;
$('#roleS').dataTable( {
"sPaginationType": "full_numbers",
"bPaginate": true,
"bProcessing": true,
"bJQueryUI": true,
"bAutoWidth": false,
"bLengthChange": true,
"aaData": table.aaData,
"aoColumns":table.aoColumns
} );

});







HTML TABLE











ERROR found in fire bug:

TypeError: nPrev is undefined
nPrev.id =oSettings.sTableId+'_previous';



Hoaping for Help.

Thanks

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Please link to a test case or use the DataTables debugger.

    Allan
  • abhi12363abhi12363 Posts: 6Questions: 0Answers: 0
    Hi Allan ,
    Thank u so much for ur reply here is dataTable debugger link Please help to resolve this issue

    http://debug.datatables.net/ohimay

    Thanks for Ur Help.
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Hi,

    It rather looks to me that something must be going wrong during the initialisation - a javascript error most likely. If you look at the Javascript console in your browser, do you see any errors reported?

    Allan
  • abhi12363abhi12363 Posts: 6Questions: 0Answers: 0
    Yes allan I debuged this code with mozilla firebug it shows error every time when ever i load this page i am sending you my findings :

    file name : jquery.dataTables.js
    Line No : 11675

    I found var els[1],els [2],els [3] is undefine on my consol because of this

    file name : jquery.dataTables.js
    Line No : 11691

    Below mentioned Variables are not able to initialise and showing undefined .

    nPrev.id =oSettings.sTableId+'_previous';
    nNext.id =oSettings.sTableId+'_next';
    nLast.id =oSettings.sTableId+'_last';

    Thanks
  • abhi12363abhi12363 Posts: 6Questions: 0Answers: 0
    Hi allan
    Thanks for ur quick rply If u want u can take a look on screen sort of consol from below mentioned link.

    https://dl.dropboxusercontent.com/u/68166830/errorConsol.png
  • abhi12363abhi12363 Posts: 6Questions: 0Answers: 0
    Hi allan Waiting for your Help Please Help me ..
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Sorry, we need a link to a test page as I asked for before and as noted in the forum rules. I don't see what the problem would be from the post you've posted.

    Allan
This discussion has been closed.