Jump to content


Photo

TUnimPanel click event


  • Please log in to reply
4 replies to this topic

#1 bbosnjak

bbosnjak

    Member

  • uniGUI Subscriber
  • PipPip
  • 48 posts

Posted 04 March 2017 - 09:25 PM

Hi,

 

I need server-side "click" event for TUnimPanel so that I can open a form. And presumably clicking any control on the panel (like labels) will not stop the underlying panel from firing the event.

 

I tried various things with the ExtEvents and UniEvents without success :-(

 

A code snippet would be greatly appreciated! 

 

Thanks in advance!


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3023 posts

Posted 05 March 2017 - 04:55 AM

Hi,

 

Can you analyze this post for now?!:

 

http://forums.unigui...parent-control/

 

Best regards.


  • 0

#3 bbosnjak

bbosnjak

    Member

  • uniGUI Subscriber
  • PipPip
  • 48 posts

Posted 06 March 2017 - 02:33 AM

Hmmmm.  Neither the TUnimPanel nor the TUnimContainerPanel (note these are "touch" not "desktop") have ExtEvents "boxready" or "afterrender".

 

Is there an equivalent event I should tap into?

Attached Files


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3023 posts

Posted 06 March 2017 - 05:19 AM

Hi,

 

Yes, I know you are using mobile version, above link has been just for analyze.

 

Ok, for mobile version you can try to use "painted" event instead of "boxready" or "afterrender".

 

 

Let's look at the following example: We have UnimPanel1 -> UnimButton1

 

1. UnimPanel1 -> ClientEvents -> UniEvents -> function afterCreate:

function afterCreate(sender)
{
    sender.element.on("tap",
        function(){
            //ajaxRequest....
        }
    )
}

2. UnimButton1 -> OnClick:

procedure TMainmForm.UnimButton1Click(Sender: TObject);
begin
  ShowMessage('Button is clicked');
end;

3. To prevent the bubbling events you can add this:

 

UnimButton1 -> ClientEvents -> ExtEvents -> function tap:

function tap(sender, e, eOpts)
{
    e.stopPropagation()
}

Try...

 

Best regards.


  • 0

#5 bbosnjak

bbosnjak

    Member

  • uniGUI Subscriber
  • PipPip
  • 48 posts

Posted 06 March 2017 - 08:58 PM

Perfect, Thanks! =)

 

I'm very weak at Javascript and web UI, which is why I turned to UniGui.  So please forgive these silly questions that any idiot would be able to figure out, because I strive to get up to the level of idiot :P


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users