data table displaystart turns to 0
data table displaystart turns to 0
manishjetly
Posts: 3Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
Allan
It worked with fnDraw(false)... also i need to know if i can change the color theme of the tables...
Manish