this.app undefined

Hi,

Is posible get this.app in a custom function in a jevView class?.

I can get this.app in config(), ready() etc. but in customFunc this.app is undefined.

Thanks in advance.

`
import { JetView, plugins } from "webix-jet";
export default class SystemView extends JetView {
     config() {
         let myapp = this.app ;  //OK
      }
      ready() {
          let myapp = this.app;  //OK
      }
      customFunc() {
          let myapp = this.app //Undefined
      }
}

this depends on the calling context, to be on a safe side, always call the method through view object

//will not work
config(){
     return { view:"button", click:this.customFunc };
}
//will work
config(){
     return { view:"button", click:() => this.customFunc() };
}
//will work as well
config(){
     return { view:"button", click:this.customFunc.bind(this) };
}

ok, thanks!!

Hello! Struggling with the same issue:

  config() {           
        var toolbar = {
            view: "toolbar",
            elements: [              
                {},               
                {
                    view: "richselect", id:"langSelect", labelAlign: "right", width: 100, value: "en", options:
                        [
                            { id: "en", value: "Eng" },
                            { id: "ru", value: "Рус" }
                        ],on: { onchange: this.toggleLanguage.bind(this) }
                }
            ]
        };       
        return toolbar;  
    };
    toggleLanguage() {  
        webix.delay(() => {
           //this is undefined here        
        })    
    }

Thanks for any help!

seems to be defined and is the Jet view as expected Code Snippet