Jump to content

Unimemo scroll to First Line


SISBLU Software

Recommended Posts

On 8/19/2020 at 12:20 PM, Sherzod said:

procedure TMainForm.UniButton1Click(Sender: TObject); begin UniMemo1.JSInterface.JSCall('inputEl.scrollTo', ['top']); end;

I have the same problem, but this solution doesn't work in modal form. 

I've noticed that sometimes JSCall, JSCode, AddJS have effect only if UniSynchronize call presents before, but in modal form I can't use UniSynchronize

May be there's some secret I don't know yet? ;)

 

Link to comment
Share on other sites

20 minutes ago, Sherzod said:

How will you call the code, through a click?

I call this code in UniTimer.OnTimer event

I have a thread which makes some actions and adds error messages to it's string  "Errors" property.

Then, in the OnTimer event , when thread's variable fWorking = False, that is my thread ends it's job - I display value of "Errors" in UniMemo. And I additionally add some lines to it. I'm not sure which ClientEvent I could use to  update umiMemo just AFTER I fill it by my "Errors" text

Link to comment
Share on other sites

3 minutes ago, Sherzod said:

And this moment is working properly? 

You mean, thread? Yes, thread works properly, "Errors" - means not application errors, but just incorrect records list, which user attempts to save to database. In other words, it's correct application behaviour. I make some additional description strings, add them to "Errors" list and add it to uniMemo. The only problem - memo scroll to last line after that

Link to comment
Share on other sites

31 minutes ago, Nadya said:

The only problem - memo scroll to last line after that

Can you try this approach?:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('dirtychange', 'function(){this.inputEl.scrollTo("top")}');

end;

 

Link to comment
Share on other sites

15 hours ago, Sherzod said:

Strange, maybe I didn't understand your issue.

Morning, Sherzod!

I've changed my previous testcase with nonmodal and modal windows to bring it's components and structure maximally closer to my real project. 

Yes, it's "business logic" looks like ravings of a madman :) I know and I'm sorry for that

testcase

So please, do following:

1) on MainForm press button "Show nonmodal form 1"

2) on page "NonModalForm1" press button "Show modal test form"

3) on modal form press button 'Start thread' and in UniFileUpload select one or two .txt files.

 

WorkThread copying files on server, then in a cycle makes some actions with every file. In case of errors the thread remembers them in property "Errors"

UniTimer traces thread work and after thread ends - adds "Errors" text to mmLog content.

I'm really sorry for annoing questions :unsure2: Thank for you kindness and help, Sherzod!

 

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