Andron
Andron

Reputation: 6631

Extjs 4 listen events for grid's selection model in controller

I have a grid and controller for it. I try listen for 'select' event for the grid.

The code is:

Ext.define('Icc.controller.Questionnaires', {
  extend: 'Ext.app.Controller',

  stores: ['Questionnaires'],

  models: ['Questionnaire'],

  views: ['QuestionnairesGrid'],

  init: function() {
      this.control({
        'mygrid > selectionmodel': {
            // do what I need here
        }
      });
  }
});

How it can be done correctly?

Upvotes: 3

Views: 3978

Answers (1)

Andron
Andron

Reputation: 6631

I found the way to do that:

init: function() {
    this.control({
        'questionnairesgrid': {
            selectionchange: this.selectionChange
        }
    });
},

Strange that I can listen events for selection model for the grid itself...

Upvotes: 5

Related Questions