Jump to content

swipe event on the form


Pink-El

Recommended Posts

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.

Link to comment
Share on other sites

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")

      }

 

    }

  )

}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...