1

I am going through the Example on MVC and i don't understand the following

1.) I didnt understand what itemdblclick means ? I know it means double clicks and when we d-click on the grid the function coresponding to it gets executed, but i don't think this is a pre-difined function. So from where does it come from. Imagine there is a button and i want it to log a message to the console saying it was clicked (as shown below) what will itemdblclick be ?

Ext.define('AM.controller.Users', {
    extend: 'Ext.app.Controller',

    views: [
        'user.List'
    ],

    init: function() {
        this.control({
            'userlist': {
                itemdblclick: this.editUser
            }
        });
    },

    editUser: function(grid, record) {
        console.log('Double clicked on ' + record.get('name'));
    }
});
4

2 回答 2

1

itemdblclick是事件的名称。您查找正在使用的控件支持的事件。例如对于按钮,它将在这里:http ://docs.sencha.com/ext-js/4-0/#!/api/Ext.button.Button

然后指定您要订阅的事件。

于 2012-07-02T19:36:43.547 回答
1

在 this.control 块中,您正在设置事件侦听器。所以 itemdblclick 是一个由 userlist 控件触发的事件名称。

于 2012-07-02T19:37:31.060 回答