Jump to content

add ClientEvent after a component is rendered


tappatappa

Recommended Posts

I am guessing whether is it possible to add a ClientEvent AFTER the component construction and render. For instance: add (or remove) a mouseover effect to a panel after the user clicks on a button.

void __fastcall TForm1::ButtonClick(TObject* Sender)
{
   Panel1->ClientEvents->ExtEvents->Values[L"mouseover"]=A_FUNCTION_BODY;
}
Link to comment
Share on other sites

Hi,

 

If I call JSAddListener multiple times, do the events cancel out?

 

Yes, it can be done...

 

 

How can I remove all the mouseover events added that way?

 

For example (JS code):

MainForm.UniPanel1.events.mouseover.listeners = [];

Use:

uses ... uniGUIJSInterface;
procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  IUniJSInterface(UniPanel1).JSAssign('events.mouseover.listeners', '[]');
end;

Best regards.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...