Jump to content

Recommended Posts

Posted

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);
begin
  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;}';
end;

procedure TMainForm.UniButton1Click (Sender: TObject);
begin
  //
end;

Will Scroll the body down and right by 100 pixels.

 

tested in FF.

 

Best regards.
 

  • Upvote 1
Posted

HI, duser!

thank you very mach.

 

 

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

 

Thank you.

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

Posted

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.

 

post-757-0-98224800-1369205169_thumb.jpg

Posted

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());})' +
                          '</script>');

Used only one UniDBGrid.

 

post-906-0-11552600-1369648283_thumb.pngpost-906-0-01448500-1369648304_thumb.png

 

GridEditors2.zip

 

 

Sincerely ...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...