I saw a good example when I was reading extjs today. Let's talk about how to register and delete a browser.
For example:
<Input type = "button" id = "button1" value = "Click me"/> <input type = "button"
Id = "button2" value = "move above me"/> </center>
<SCRIPT>
Function buttononclick1 () {alert ('triggered when the first click event registered with extjs ')}
Function buttononclick2 () {alert ('triggered by the second click event registered with extjs ')}
Function Init ()
{
VaR button1 = ext. Get ('button1 ');
VaR button2 = ext. Get ('button2 ');
Button1.on ('click', buttononclick1 );
Button1.on ('click', buttononclick2 );
Button2.on ('mousemove ', function (OBJ) {alert (button2.getvalue (); button1.un ('click', buttononclick2 )});
}
Ext. onready (init );
</SCRIPT>
Note:
Button2.on ('mousemove ', function (OBJ) {alert (button2.getvalue (); button1.un ('click', buttononclick2 )});
When you click button1, The buttononclick2 () event is triggered first, because in extjs, It is triggered first after registration,
Therefore, the second click event registered with extjs is triggered first, and the first click event registered with extjs is triggered ';
Then, the "UN" event cancels the "buttononclick2" event in "button1". So when you move the mouse over "button2" and then click the first button, the first click event registered with extjs is triggered'