How can I call a function from an event handler?
webix.protoUI({
name:'customView',
$init: function (config) {
config.head = {
view: 'toolbar',
height: "auto",
cols: [
{
align: 'center',
},
{
view: "button",
id: "New_" + _id,
value:"+New",
width:100,
on: {
onItemClick: function() {
this.addNew(); // does not work
$$(this.config.id).addNew(); // does not work
}
}
},
{
view: 'button',
align: 'right',
type: 'icon',
icon: 'close',
width: 30,
on: {
onItemClick: function () { webix.message("Close!"); }
},
}
]
};
config.body = {
view: 'scrollview',
scroll: 'y',
body: { ... },
width: 600,
height: 400
};
},
addNew: function () {
// do cool stuff
}
}, webix.ui.window);