0

I'm using Deftjs´s ViewControllers, and now I had to pass some variables from a controller to another.

How is the best way, since I create a view and not a controller?

My actual solution is:

In controller 1:

var me = this;
var win = Ext.create('App.view.car.Window');
win.getController().setBrandId(me.brandId);
win.getController().setColorId(me.colorId);
win.show();

and my controller for car view:

Ext.define('App.controller.car.WindowController', {
    extend: 'Deft.mvc.ViewController',
    config: {
        brandId: null,
        colorId: null
    },
....

Thanks,

Beetlejuice
  • 4,292
  • 10
  • 58
  • 84

1 Answers1

0

The solution for your question is like this:

var win = Ext.create('App.view.car.Window' {
    controllerConfig: {
        brandId: me.brandId,
        colorId: me.colorId    
});
win.show();

controllerConfig is section of configuration which is pass as normal config for controller.

hsd
  • 452
  • 5
  • 12