bbosnjak Posted March 4, 2017 Share Posted March 4, 2017 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 More sharing options...
Sherzod Posted March 5, 2017 Share Posted March 5, 2017 Hi, Can you analyze this post for now?!: http://forums.unigui.com/index.php?/topic/7871-how-can-i-prevent-onmousedown-event-of-parent-control/ Best regards. Link to comment Share on other sites More sharing options...
bbosnjak Posted March 6, 2017 Author Share Posted March 6, 2017 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? Link to comment Share on other sites More sharing options...
Sherzod Posted March 6, 2017 Share Posted March 6, 2017 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 More sharing options...
bbosnjak Posted March 6, 2017 Author Share Posted March 6, 2017 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 More sharing options...
Recommended Posts