Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1817

javascript error if I enter 0 in input pagination in datatables-input pagination plugin used

$
0
0
1-error occurs if I enter 0 in input pagination in datatables Here I am getting aoData as undefined ,hence giving error during checking of aoData.nTR(line 14 here)..is any solution their to handle error if we enter 0 in pagination??

error at --if ( aoData.nTr === null ) ,here aoData is undefined if we enter 0 in pagination

This happens only when I search something and enter out of range +ve value in pagination box like 0 or 36 in condition their are only 3 pages(eg Page 1 of 3)

2-Also Entering 31 changes input(eg- Page 1 of 3,here 1 is input) to 3(if 31 is out of range) but if we enter -21 it does not change automatically to 0

plugin used for datatables is taken from http://datatables.net/plug-ins/pagination .Also jquery.dataTables.js version used is 1.9.4

if ( oSettings.aiDisplay.length !== 0 )
{
    var iStart = oSettings._iDisplayStart;
    var iEnd = oSettings._iDisplayEnd;

    if ( oSettings.oFeatures.bServerSide )
        {
            iStart = 0;
            iEnd = oSettings.aoData.length;
        }

    for ( var j=iStart ; j<iEnd ; j++ )
    {
      var aoData = oSettings.aoData[ oSettings.aiDisplay[j] ];
       if ( aoData.nTr === null )
            {
            _fnCreateTr( oSettings, oSettings.aiDisplay[j] );
            }

Viewing all articles
Browse latest Browse all 1817

Trending Articles