Kanat Posted May 21, 2013 Posted May 21, 2013 Hello everyone! how to programmatically scroll the scroll box. thank you Quote
Sherzod Posted May 21, 2013 Posted May 21, 2013 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. 1 Quote
Kanat Posted May 22, 2013 Author Posted May 22, 2013 HI, duser! thank you very mach. Your example works. But now another problem appeared to do simultaneous skrolining unidbrid and scroll box. Thank you. Quote
Sherzod Posted May 22, 2013 Posted May 22, 2013 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. Quote
Kanat Posted May 22, 2013 Author Posted May 22, 2013 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. Quote
Sherzod Posted May 22, 2013 Posted May 22, 2013 Hi Kanatshym.Sorry, so far I do not have any solutions. I'll try. If things turn out I'll post... Sincerely ... Quote
Sherzod Posted May 27, 2013 Posted May 27, 2013 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. GridEditors2.zip Sincerely ... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.