Jump to content

TUnimPanel click event


bbosnjak

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

×
×
  • Create New...