Jump to content

Desktop HTMLFrame - Script Updated At Runtime - How Can We Force Scroll-To-Top via code ?


Recommended Posts

Posted

Subject to user interaction we change the contents of a HTMLFrame (our frame has a pre-specified height):-

BeginUpdate
Clear

script

EndUpdate

The previous contents were many many lines long forcing the user to scroll to bottom, now that we have new contents I want to reposition to the top.

How Can We Force Scroll-To-Top in code ?

 

Posted
6 hours ago, andyhill said:

Subject to user interaction we change the contents of a HTMLFrame (our frame has a pre-specified height):-

BeginUpdate
Clear

script

EndUpdate

The previous contents were many many lines long forcing the user to scroll to bottom, now that we have new contents I want to reposition to the top.

How Can We Force Scroll-To-Top in code ?

Hi,

Sorry, do you have a simple testcase to see the "problem"!?

Posted

Set Flag in Server Module BeforeInit to suit (we have multiple frameworks).

As stated above clearly, I need to scroll to the top of the HTMLFrame via code at runtime after script update.

Project1.zip

Posted

Sherzod, Please advise how to force in code at runtime a horizontal Scroll-To-Top for a HtmlFrame (after the script has been updated) - thanks.

Posted
6 hours ago, andyhill said:

Please advise how to force in code at runtime a horizontal Scroll-To-Top for a HtmlFrame (after the script has been updated) - thanks.

Hi,

In your case:

procedure TMainForm.UniHTMLFrame1UpdateHtml(Sender: TObject);
begin
  UniPanel2.JSInterface.JSCall('body.setScrollTop', [0]);
end;

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...