data table displaystart turns to 0

data table displaystart turns to 0

manishjetlymanishjetly Posts: 3Questions: 0Answers: 0
edited July 2011 in DataTables 1.8
I am new to the data tables and working with the following code:
var oTable;


$(document).ready(

function () {



TableToolsInit.sSwfPath = "/common/ZeroClipboard.swf";
oTable = $('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": "/Ajax/Services.asp?random="+Math.floor(Math.random()*1001),
"fnServerData": function (sSource, aoData, fnCallback )
{
aoData.push( { "name": "chkFilter", "value": strFilter} );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
},
"sDom": 'C<"clear">lfrtip',
"sPaginationType": "full_numbers",
"aoColumns": [
{"bSortable": true},
{"bSortable": true},
<%If Session("FacilityID") <> "" Then%>
{"bVisible": false},
<%Else%>
{"bSortable": true},
<%End If%>
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": true},
{"bSortable": false},
{"bSortable": false}
]
});

//$("div.TableTools").mouseenter(function() {oTable.fnSetColumnVis(8, false);oTable.fnSetColumnVis(9, false);oTable.fnSetColumnVis(7, false);});
//$("div.TableTools").mouseleave(function() {oTable.fnSetColumnVis(8, true );oTable.fnSetColumnVis(9, true );oTable.fnSetColumnVis(7, true );});


$("#filter").buttonset();


$(document).everyTime(15000, function()
{
oTable.fnReloadAjax(oTable.fnSettings());
$('#frmMain :radio.star').rating();

});


});

working fine with no issue also on click of the next button i am able to see next table page with another 10 records. but after some time it start from 1 page(whenever i call fnReloadAjax) than being on the selected page. when i checked the display start values it was 10 on click of next page but turns to 0 on fnReloadAjax call.
I want the selected display start value should be there in case of fnReloadAjax call.

Not sure where I am missing.

Manish

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Since you are using server-side processing, you shouldn't use fnReloadAjax (as noted in the description of fnReloadAjax). Just call fnDraw() to reload the table from the server, keeping the current page etc.

    Allan
  • manishjetlymanishjetly Posts: 3Questions: 0Answers: 0
    Thanks Allan,

    It worked with fnDraw(false)... also i need to know if i can change the color theme of the tables...

    Manish
This discussion has been closed.