FMirande Posted July 18, 2016 Posted July 18, 2016 Hi I'm using a TUnimPanel included in a TUnimScrollBox. When I scroll down, it automatically scrolls up !!! Did someone can explain me what's wrong ?Was it a configuration problem ? Thanks Fred Quote
Sherzod Posted July 18, 2016 Posted July 18, 2016 Hi, Can you make a small test case for this ?! Best regards. Quote
FMirande Posted July 18, 2016 Author Posted July 18, 2016 Hi I have done a little test case. How can I send it to the forum ? Thanks Quote
FMirande Posted July 19, 2016 Author Posted July 19, 2016 Hi I actually work as freelance developer. My UNIGUI licence as been registered by boss company I was working for. So I can't upload my test case directly to the forum ! For developers who want and can help me, you can find a simply test case that show my problem following the link http://www.atout-logiciel.com/TestCase_UniMScrollPb.zip Thanks Quote
Sherzod Posted July 20, 2016 Posted July 20, 2016 For developers who want and can help me, you can find a simply test case that show my problem following the link http://www.atout-logiciel.com/TestCase_UniMScrollPb.zip Hi, For now can you try this? (quick and dirty workaround): 1. public { Public declarations } scrlHeight: integer; // <------- procedure _setHeight(AScrollBox: TUnimScrollBox; AHeight: Integer); end; 2. ... if scrlHeight < scrlPanier.Height then begin pnlDetailCommande.Height := scrlPanier.Height - 10; end else begin //scrlPanier.SetBounds(0, 0, scrlPanier.Width, scrlHeight); scrlPanier.Height := scrlHeight; pnlDetailCommande.Height := scrlHeight; end; _setHeight(scrlPanier, scrlHeight); // <------- ... 3. procedure TMainmForm._setHeight(AScrollBox: TUnimScrollBox; AHeight: Integer); begin UniSession.AddJS('setTimeout(function(){' + AScrollBox.JSName + '.scrollableBehavior.scrollView.getScroller().maxPosition.y = ' + IntToStr(AHeight) + '}, 500)' ); end; 4. procedure TMainmForm.UnimFormResize(Sender: TObject); begin _setHeight(scrlPanier, scrlHeight); end;Best regards. Quote
FMirande Posted July 20, 2016 Author Posted July 20, 2016 As we said at home, champion !!! It works fine. An other question, I'm using a TunimTabPanel and I want to change active page swiping left and right. Did have I to do something like you have done ? An other question bis ... Where can I find any help topic about JS programming in uni gui ? Thanks a lot !!! Quote
Sherzod Posted July 20, 2016 Posted July 20, 2016 An other question, I'm using a TunimTabPanel and I want to change active page swiping left and right. Did have I to do something like you have done ? Hi, For now try: 1. UnimTabPanel1->ClientEvents->UniEvents->... afterCreate fn: function afterCreate(sender) { sender.element.on("swipe", function(e) { if (e.direction) { ajaxRequest(MainmForm.form, "swipe", ["direction="+e.direction]); } } ) } 2. MainmForm->onAjaxEvent: procedure TMainmForm.UnimFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'swipe' then begin if Params.Values['direction'] = 'left' then begin if UnimTabPanel1.ActivePageIndex > 0 then UnimTabPanel1.ActivePageIndex := UnimTabPanel1.ActivePageIndex - 1 end else if Params.Values['direction'] = 'right' then UnimTabPanel1.ActivePageIndex := UnimTabPanel1.ActivePageIndex + 1 end; end; Best regards. Quote
FMirande Posted July 20, 2016 Author Posted July 20, 2016 Hi Code tried and validated ! One more time, it works fine !!! I would like to do another developments like this. Is there any help topic about JS programming in uni gui ? Quote
natanael Posted July 25, 2017 Posted July 25, 2017 Hi, For now can you try this? (quick and dirty workaround): 1. public { Public declarations } scrlHeight: integer; // <------- procedure _setHeight(AScrollBox: TUnimScrollBox; AHeight: Integer); end; 2. ... if scrlHeight < scrlPanier.Height then begin pnlDetailCommande.Height := scrlPanier.Height - 10; end else begin //scrlPanier.SetBounds(0, 0, scrlPanier.Width, scrlHeight); scrlPanier.Height := scrlHeight; pnlDetailCommande.Height := scrlHeight; end; _setHeight(scrlPanier, scrlHeight); // <------- ... 3. procedure TMainmForm._setHeight(AScrollBox: TUnimScrollBox; AHeight: Integer); begin UniSession.AddJS('setTimeout(function(){' + AScrollBox.JSName + '.scrollableBehavior.scrollView.getScroller().maxPosition.y = ' + IntToStr(AHeight) + '}, 500)' ); end; 4. procedure TMainmForm.UnimFormResize(Sender: TObject); begin _setHeight(scrlPanier, scrlHeight); end;Best regards. Is there another solution? This leaves a space of exesivo height and is very little controllable. Quote
natanael Posted July 25, 2017 Posted July 25, 2017 hello Is there another solution? This leaves a space of exesivo height and is very little controllable. Quote
Sherzod Posted July 25, 2017 Posted July 25, 2017 Hi, hello Is there another solution? This leaves a space of exesivo height and is very little controllable. Which edition and build are you using ?! Can you give more information, screenshots, make a testcase?! Best regards, Quote
natanael Posted July 27, 2017 Posted July 27, 2017 Hi, Which edition and build are you using ?! Can you give more information, screenshots, make a testcase?! Best regards, hello, my firend I'm using version 1.0.0.1383. I have the same problem as Newbie. You can take the same project. look . When you solved it. Leaves an unusable height. Take the project http://www.atout-logiciel.com/TestCase_UniMScrollPb.zip At the bottom of the page there is an ana height of 400px not used I can adjust the height. But from server side to client. I would like this to be done automatically. thanks ! 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.