0

I have the following situation, In an ExtJS MVC Controller I have the following lines that makes a custom window visible:

this.control({
    'grid_file button[action=change_settings]': {
        click: this.open_settings
    }
})

Further below:

open_settings: function() {
    this.getView('browser.storage_settings').create().show();
},

I want to add a cancel button to make this window invisible, how would I do that without adding an id? What would be the event listener and what would be the code inside the function?

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
Art F
  • 3,992
  • 10
  • 49
  • 81

1 Answers1

0

You can specify an itemId (not the same as id) to access components with getComponent in a container.
The up() and down() methods are also a good way to retrieve components if you have a good structure.

The best way IMO to solve your problem is to define a button in your window like this:

buttons:[{
    text: 'Close',
    handler: function() {
        this.hide();
    }
}]

You can make a panel invisible with the .hide() method (look at the hideMode config too for more options).

A1rPun
  • 16,287
  • 7
  • 57
  • 90