click of ui.button, Properties Webix Docs
click action handler
function click;
Example
webix.ui({
view:"button", id:"btn1", click:function(id,event){
// your code here
webix.message("Click on button " + id);
// "Click on button btn1"
}
});
//or
function handler(id){
// your code here
webix.message("Click on button " + id);
// "Click on button btn1"
}
webix.ui({
view:"button", click:handler
});
Details
The click property is a short alias for some.attachEvent("onItemClick", code); for buttons and other control widgets.
Inside the handler, "this" points to the view object.
The function receives two parameters:
- id (string, number) the ID of the button
- event (object) MouseEvent