0

I have a view designed like that:

Ext.define('MY.view.NotificationMails', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.NotificationMailsPanel',
    id: 'id-notification-mails-panel',

and I have controller for this view which is:

Ext.define('MY.controller.NotificationMailsController', {
    extend: 'Ext.app.Controller',
    models: [
    'NotificationMailsRecord'
    ],

    stores: [
    'NotificationMailsStore'
    ],

    views: [
    'NotificationMails'
    ],
//  refs:[{
//      ref: 'notificationMails',
//      selector: 'mailGrid'    
//  }],

    init: function()    {
        this.control({
            '#id-notification-mails-panel': {

                itemclick: this.clickedSomething
            }

        })

    },

and just to make some test and eventually find the problem a simple function definition for itemclick :

clickedSomething: function() {
    console.log('Deteceted click');
}

But nothing happens. I tried many variations and still can't get my actions from the view to execute functions in the controller. The curios thing is that I have several controllers and in most of them everything works as expected but this one and few others - I don't know - maybe I do something wrong, maybe the reason is somewhere else.

thanks

Leron

,

4

1 回答 1

1

This is weird. I'd try the following: console.log within init() to see if the controller is initialized (you might have forgotten to include it in your app list of controllers).

于 2012-06-08T08:40:33.600 回答