Maintain scroll position on postback

Maintain scroll position on postback

sumitkmsumitkm Posts: 1Questions: 0Answers: 0
edited June 2011 in General
Hi,
I am using DataTables plug in in a 'rather unusual' circumstance. My page is an ASPX page and data is bound on server side in .NET to a GridView server control. I also have ASP.NET AJAX enabled on the page.

I got the DataTables to work with minimal configuration, following is my code
[code]
var tableId = '#' + table.id;
$(tableId).dataTable({
"sScrollY": "200px",
"bJQueryUI": true,
"bPaginate": false,
"bRetrieve":true,
"bStateSave": true
});
[/code]
Main intent of using DataTables was to have a consistent Fixed Header behavior across IE8/IE7/FF4 and scrolling. The above code does that. However one thing missing is since the 'control' is server side all editing is handled at server side. So once my Edit/Update happens, the scroll position is lost. Without the bRetrieve: true dataTables was throwing an error on postback. That's fixed now. But the scroll position is still an issue. Anyway I can drop the position as a cookie and pick it up on re-initialization? Any direction will be helpful.
This discussion has been closed.