Pink-El Posted January 19, 2016 Posted January 19, 2016 Hello, I need help. How to catch onswipe event on the form? Dmytro Quote
Sherzod Posted January 19, 2016 Posted January 19, 2016 Hi, Can you clarify the issue, in the mobile version? Best regards. Quote
Sherzod Posted January 20, 2016 Posted January 20, 2016 Hi, Try this solution: MainmForm -> ClientEvents -> UniEvents [Ext.Container[window]] add window.afterCreate fn: function window.afterCreate(sender) { sender.element.on("swipe", function(e){ // your logic alert("onSwipe") } ) } * function(e)... e = Ext.event.Touch Best regards. Quote
Pink-El Posted January 20, 2016 Author Posted January 20, 2016 Hello, I found how to catch direction of the swipe but I can not to find how to close current form in the script. Hide method works but I need close. Have you any ideas? function window.afterCreate(sender) { sender.element.on("swipe", function(e){ if(e.direction=='right') { alert("onSwipeRight"); window.Close(); } if(e.direction=='left') { alert("onSwipeLeft") } } ) } Quote
Sherzod Posted January 20, 2016 Posted January 20, 2016 Hi, * how to close current form in the script? I'm sorry, what do you mean,can you more detail .. or a small test case? Best regards. Quote
Pink-El Posted January 20, 2016 Author Posted January 20, 2016 Well, my form is scrollable and too long. When the user swipe screen to left or to right I need close current form and back to the previews form. Quote
Sherzod Posted January 20, 2016 Posted January 20, 2016 if I understand you correctly, try: for example, for UnimForm3: function window.afterCreate(sender) { sender.element.on("swipe", function(e){ ajaxRequest(sender, '_close', []) } ) } procedure TUnimForm3.UnimFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName = '_close' then begin Close; end; end; Best regards. 1 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.