0
votes

How can I receive clickitem events in Extjs 4 Grid for all but two columns. The event:

itemclick( Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e, Object eOpts )

Doesn't tell me on which column I clicked. When user clicks on checkbox or actioncolumn I want to execute the specific handlers for those elements and when user clicks on anything else I want to open a dialog showing selected record. The problem is that first the specific handlers are called and then the itemclick event is executed. How can I handle that problem? Either: - skip calling itemclick handler? - get column number in the itemclick event

1

1 Answers

0
votes

You can use cell-selectionmodel and work with the select event. Something like:

Ext.create('Ext.grid.Panel', {
    ...
    selType: 'cellmodel',
    listeners: {
        'select': function(selection, models, eOpts) {
            var pos = selection.getCurrentPosition();
            if (pos) {
                Ext.Msg.alert('Column Position', pos.column);
            }
        }     
    }
}