Jump to content

Analog of the OnMouseMove or OnClick property in a UniFrame


artem_niko

Recommended Posts

Good afternoon! 
Is there (is it possible) for a UniFrame to have an analog of the OnMouseMove or OnClick property?
I need to execute some code while the mouse cursor is within the entire UniFrame.
An important point: it does not matter which component the mouse is specifically located on or activated (UniEdit or UniPanel, etc.). Exactly, as long as it is within the UniFrame.

Link to comment
Share on other sites

6 minutes ago, Sherzod said:

But what kind of code do you want to execute, client side or server side? Because let's say the mousemove event will be called many times...

What kind of code?
Well, passing a pair of variables from UniFrame to MainForm. There will be no SQL queries or database accesses at this point.

Link to comment
Share on other sites

2 minutes ago, Sherzod said:

Well, the first link is not exactly what I need...
the second link, yes, something like that.

But, will it work if the mouse cursor is over another component, for example, which is in a UniFrame?

Link to comment
Share on other sites

14 minutes ago, artem_niko said:

Well, if it can be done on the client side, then it would be better. The question is how to apply this code simply

For example, try.

In your frame, on the OnCreate event, the event will be sent to the owner form (you can also configure the buffer config, which will invoke the event after the specified time...)

Self.ClientEvents.ExtEvents.Values['afterrender'] := 'function afterrender(sender, eOpts){sender.on("mousemove", function(){ajaxRequest('+ Self.OwnerWebForm.JSName +', "_mousemove", {frameName: "'+ Self.Name +'"})})}';

 

  • Like 1
Link to comment
Share on other sites

With buffer config (1000 ms):

Self.ClientEvents.ExtEvents.Values['afterrender'] := 'function afterrender(sender, eOpts){sender.on({mousemove: function(){ajaxRequest('+ Self.OwnerWebForm.JSName +', "_mousemove", {frameName: "'+ Self.Name +'"})}, buffer: 1000})}';

 

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...