View Variables from init()

Has something changed recently?

I am doing a new project and I can’t seem to access the variables in the main config(). I used to able to in a previous project.

For example

export default class OrderSummaryView extends JetView {   
    
    config(){

        var order = {};

  }

 init(){

   this.on(this.app,"order:loaded",newOrder => {

   this.order = newOrder; // The this.order is undefined. I've tried numerous avenues this.$scope, this.config etc etc
  
   });

 }
}

looks like everything is ok
check this
https://snippet.webix.com/ws8hag41

Hey, Splay, please note that there is actually no way you can access a variable that doesn’t lie within your scope. So, for example, config() and init() have completely different scopes and you wouldn’t be able to access the variable declared in scope 1 in your scope 2, unless scope 2 is nested within scope 1:

 config(){

        var order = {};
        function() {
          return order;
        }
  }

However, I would like to point out that these scopes do share a common context this, which would refer to their respective JetView class.

Thanks @intregal , I added in where I have the variable at line 7 here https://snippet.webix.com/vuve1wl6

@Dzmitry thanks, I’m starting to understand that now.