Scroller Server Side with Saved State - Doesn't retain selected page
Scroller Server Side with Saved State - Doesn't retain selected page
Hello,
Awesome tools! A real breath of fresh air after developing with chunky asp controls!
I have a problem with retaining state when reloading the page. The state is preserved but the Scroller does not move to the correct page of data. The grid is blank, but if you scroll down to the correct page, data is displayed.
In summary:
initial grid loads ok
scroll to record 2000 ok
refresh the page (or click on a link and then click back)
grid is displayed 1 - 35 with no data
scroll to record 2000 and data appears
Code is:
[code]
var tabHeight = 500;
var tabWidth = 500;
$(document).ready(function () {
$('#tabData').dataTable({
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"sScrollY": tabHeight,
"sScrollX": tabWidth,
"sDom": "frtiS",
"sPaginationType": "full_numbers",
"sAjaxSource": "NewsData.aspx",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
[/code]
Any ideas most gratefully received, has anyone else got this working?
Cheers,
David
Awesome tools! A real breath of fresh air after developing with chunky asp controls!
I have a problem with retaining state when reloading the page. The state is preserved but the Scroller does not move to the correct page of data. The grid is blank, but if you scroll down to the correct page, data is displayed.
In summary:
initial grid loads ok
scroll to record 2000 ok
refresh the page (or click on a link and then click back)
grid is displayed 1 - 35 with no data
scroll to record 2000 and data appears
Code is:
[code]
var tabHeight = 500;
var tabWidth = 500;
$(document).ready(function () {
$('#tabData').dataTable({
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"sScrollY": tabHeight,
"sScrollX": tabWidth,
"sDom": "frtiS",
"sPaginationType": "full_numbers",
"sAjaxSource": "NewsData.aspx",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
[/code]
Any ideas most gratefully received, has anyone else got this working?
Cheers,
David
This discussion has been closed.
Replies
For a temporary solution, i modify start and end values in fnSaveState (just like infinite scroll does) so it gets the first set of results when the page is reloaded.
But I would also like if it scrolled to the correct position on load state .)
in my example, it can't pass the control iDraw==2 (in scroller.js) and doesn't scroll as the idraw value is 1.