Skip to content

on_click

redefines default click behavior for component items.

let on_click: EventHash
grid = webix.grid({
columns:[
{ id:"rank", header:"", css:"rank", width:50},
{ id:"title", header:"Film title",width:200},
{ id:"", template:"<input class='delbtn' type='button' value='Delete'>",
css:"padding_less",width:100 }],
on:{
"onItemClick":function(id, e, trg){
console.log("Click on row: " + id.row+", column: " + id.column);}
} //default click behavior that is true for any datagrid cell
});
// click behavior for the cell with a button styled with 'delbtn' class
grid.on_click.delbtn=function(e, id, trg){
console.log("Delete row: "+id);
return false; //here it blocks default behavior
};

also check the next samples:

  • “on_click” stores default and attached click behavior for component items;
  • Additional click events are attched with the ‘onItemClick’ handler;
  • on_click handler is used to redefine the default onclick event right in the component constructor:

you can check the full snippet DataGrid: Custom Handler

Articles

API