How to get application scope to find service in webix jet from event handler in dtatatable subview

i have subview using webix jet, my issue that i can’t access to $scope or other application (jet) stuff if i call it from onSelectChange event from subview

https://webix.com/snippet/dd5e9dcf

i tried this.$scope.app and like that but “this” points to row in subview and i cant use any webix jet feature lire $scope e.t.c.
as a workaround i use: webix.$$(“template_list_datatable”).$scope.app.getService(“parents_list_view”)
but it look very ugly

you can pass master table reference to subview in onSubViewCreate event and use this reference later

{
    onSubViewCreate: function(view, item){
        view.parse(item.outlets);
        view._master = this;
    }
}
and use as `this._master.$scope.app.getService(...)`

Thank you @intregal !
It works but looks like hack. Is it kind of lack of feature functionality or it is a normal practice to use that kind of passing objects like you offered?

@Tiger_dsh I’ve just found that there is an undocumented method (at least I did not find in docs) getMasterView using which you can get master table without mentioned hack. nevertheless, I think that master table $scope must be passed to subview as well.

{
    onSubViewCreate: function(view, item){
        view.parse(item.outlets);
    }
}
and use as `this.getMasterView().$scope.app.getService(...)`

Hi,

The behavior will be changed in Webix 5.2 (February 22). The $scope property on subview elements will be fixed and it will point to the related JetView.

Also, we plan to extend Webix Jet so you will be able to use a Jet View class as value for subview property ( it will cover all other cases where views are created dynamically as well ). This will be included in the next minor update of Webix Jet, most probably in the first part of March.

I’ve just found that there is an undocumented method (at least I did not find in docs) getMasterView

The method is intended to be public. We will fix the documentation