Kanat Posted May 21, 2013 Share Posted May 21, 2013 Hello everyone! how to programmatically scroll the scroll box. thank you Link to comment Share on other sites More sharing options...
Sherzod Posted May 21, 2013 Share 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 Link to comment Share on other sites More sharing options...
Kanat Posted May 22, 2013 Author Share 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. Link to comment Share on other sites More sharing options...
Sherzod Posted May 22, 2013 Share 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. Link to comment Share on other sites More sharing options...
Kanat Posted May 22, 2013 Author Share 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. Link to comment Share on other sites More sharing options...
Sherzod Posted May 22, 2013 Share 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 ... Link to comment Share on other sites More sharing options...
Sherzod Posted May 26, 2013 Share Posted May 26, 2013 Hi Kanatshym.You have found a solution? Link to comment Share on other sites More sharing options...
Sherzod Posted May 27, 2013 Share 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 ... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now