Jump to content

Scrolling the scroll box.


Recommended Posts

Hi Kanatshym.

To start such a decision. Maybe there are other solutions.
Try this:

Add the button to the form UniButton1.

procedure TMainForm.UniFormCreate (Sender: TObject);
  UniButton1.ClientEvents.Enabled := True;
  UniButton1.ClientEvents.ExtEvents.Values ​​['OnClick'] := 'function OnClick (sender, e) {MainForm.UniScrollBox1.body.dom.scrollTop = 100; MainForm.UniScrollBox1.body.dom.scrollLeft = 100;}';

procedure TMainForm.UniButton1Click (Sender: TObject);

Will Scroll the body down and right by 100 pixels.


tested in FF.


Best regards.

  • Upvote 1
Link to comment
Share on other sites

But now another problem appeared to do simultaneous skrolining unidbrid and scroll box.


Hi Kanatshym.


Sorry if I misunderstood the question.


If you need scrolling to the grid can use the following code:


UniButton1.ClientEvents.ExtEvents.Values ​​['OnClick'] := 'function OnClick (sender, e) {MainForm.UniDBGrid1.scrollByDeltaX (10); MainForm.UniDBGrid1.scrollByDeltaY (10);}';

Best regards.

Link to comment
Share on other sites

Thanks for the quick reply.
Sorry if asked correctly (use google translate).
I'd like to do that would at the same time in parallel with scrolling unidbgrid uniscrollbox.

I want to create a project form.

image attached.



Link to comment
Share on other sites

Hi Kanatshym.


A solution using jquery:

1. You need to download file jquery. Paste the file to folder (.....\files\), connect jquery (ServerModule -> CustomFiles -> add files/jquery-1.3.2.min.js)

2. Add in the form UniHTMLFrame.

3. In the OnCreate form add the following code:

UniHTMLFrame1.HTML.Add ('<script>' +
                          '$(".x-grid-view").css("overflow-y", "hidden");' +
                          '$("#' + UniScrollBox1.JSName + '_id-body").scroll(function(){' +
                          '$(".x-grid-view").scrollTop($("#' + UniScrollBox1.JSName + '_id-body").scrollTop());})' +

Used only one UniDBGrid.







Sincerely ...

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.

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