1
votes

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'));
    }
});
2

2 Answers

1
votes

itemdblclick is the name of event. You look for events supported by the control you're working with. For example for button it will be here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.button.Button

And then specify event you're subscribing to.

1
votes

In the this.control block, you are setting up event listeners. So itemdblclick is an event name that is fired by the userlist control.