Jump to content

UniScrollBox sempre com o topo no inicio


eduardosuruagy

Recommended Posts

 

I had already tried these options yesterday, but they all make mistakes. The errors are these:

 

Cannot read property 'scrollTo' of undefined
 
procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniSession.AddJS(UniScrollbox1.JSName+'.body.scrollTo(''Top'', 0, true);');
end;
 
 
---
 
Cannot set property 'scrollTop' of null
 
procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniSession.AddJS('document.getElementById("'+UniScrollBox1.JSName+'_id-body").scrollTop = 0;');
end;
Link to comment
Share on other sites

Hi,

 

I couldn't reproduce your issue, it seems that you have active control at the end

 

If I understand you correctly, can you try this approach for now ?!:

 

1. UniScrollBox1 -> ClientEvents -> UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    config.autoScroll=false;
}

2. MainForm -> OnReady event:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniScrollBox1.JSInterface.JSCall('setAutoScroll', [True]);
end;

Best regards,

Link to comment
Share on other sites

Hi,

 

I couldn't reproduce your issue, it seems that you have active control at the end

 

If I understand you correctly, can you try this approach for now ?!:

 

1. UniScrollBox1 -> ClientEvents -> UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    config.autoScroll=false;
}

2. MainForm -> OnReady event:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniScrollBox1.JSInterface.JSCall('setAutoScroll', [True]);
end;

Best regards,

 

Unfortunately it did not work

Link to comment
Share on other sites

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...