Search code examples
gridselectioncellextjs4.1

Disable selection on first column of grid


Is there a way to disable selection on the first column of a grid only. I have 2nd and 3rd column as 'checkcolumn', which fires selection for that row. That's why I cannot entirely use

disableSelection: true

on the grid, because this would disable the selection fire event on checkboxes. The first column is just a text, and I don't want selection of that row when the first column's row is clicked.

Any help?


Solution

  • The beforeitemmousedown event will probably work for you, add it as a listener where you declare your grid and return false when the event's target is the first cell in the row:

    listeners: {
        beforeitemmousedown: function(view, record, item, index, e, eOpts)
        {
            if(item.cells[0] == e.target.parentElement)
                return false;
        }
    }