iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
We are using Webgrid7 for displaying self heretical data in SharePoint web part. We do have other controls placed outside of grid, which cause post back of page. The post back causes the scroll position to be set on the top for the grid. We need to maintain the scroll position to last selected record in grid after the post back.
We have tried following example from webgrid documentation:
Walkthrough: Maintaining scroll position
It seems it will work fine if postbacks occures due to grid's internal action....
anybody can help me to get it resolved?
Waiting for reply.......
Thanks & Regards.
G.S
Similar to the Maintaining scroll position walkthrough, in order to achieve this you will need to buffer the scrolltop position during onScroll client side event.
One of the simplest method would be using a cookie to buffer the value, as shown in this post.
Attached is the simple sample used to demonstrate such scenario.
Since WebGrid still could not persist selef reference state after postback, in a self refrence scenario this method might fail to set the scrolltop position correctly.
Hello Glenn,
Thanks for your kind support. I have tried the solution provided by you in this thread for maintaining grid scroll position. I have implemented same in MOSS 2007 web part. My Issue is that it is working perfectly fine in IE browser, but the same solution is not working for Mozilla and safari.
I have created sample web site and added the sample pages attached in this thread. I tried to run the sample page from IE, Mozilla and Safari browsers. The result is same as with my MOSS 2007 web part, Its work fine for IE but not for Mozilla and safari.
Will you please check the same at your end and provide me the solution ASAP?
We have delivery in this week and it is delayed due to this issue. Please consider this issue for priority work.
Waiting for your kind reply.
Thanks,
In my test, it seems in Safari and Firefox browser, during body onload the content WebGrid height has not been set correctly so the ScrollTop assigment fails. You will need to use the setTimeout function to let the WebGrid set the proper height in order to set ScrollTop property.
Here is the modified snippet, in my test a delay of 10ms will be enough to properly set the ScrollTop correctly:
function body_OnLoad(){ var strCook = document.cookie; if (strCook.indexOf("!~") != 0) { var intS = strCook.indexOf("!~"); var intE = strCook.indexOf("~!"); var strPos = strCook.substring(intS + 2, intE); var grid = ISGetObject("wgTest"); setTimeout(function() { grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV).scrollTop = strPos; }, 10); } }
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname