I have created a custom component using protoUI, extending datatable with a few properties and methods. This new table is created in a dashboard using a factory.
When I try to call the table methods, they can’t access the instance properties with ‘this’. What am I missing?
Example here: https://snippet.webix.com/n5v5q6kf
hi @Skartknet
if you are about line 67 then try to use classic function instead of bold arrow.
webix.protoUI({
name: "vsualDataTable",
nodeConfig: null, // stores all the configuration of the view as an object so we can map it when editing its properies.
query: "query",
Save: function(config) { /*!!!*/
webix.alert(this.query);
}
}, webix.ui.datatable)
arrow function in object uses parent scope
Thanks! I didn’t know that. this is literally the first time I use the arrow function in JS