PDA

View Full Version : Change selection only on specific column



EmCy90
7 Feb 2013, 1:10 AM
Lets say we have a grid panel with column A and column B. What i want to do is the selection to be changed only when the user selects the part of the row that is under column A. Is this possible ?

Arg0n
7 Feb 2013, 1:17 AM
It is:



getTargetFromEvent: function(event) {
var me = this,
view = me.view;


var cell = event.getTarget(view.cellSelector);


if (this.targetCell !== cell) {
view.fireEvent('cellchange', this.targetCell, cell, event);
this.targetCell = cell;
}


if (cell) {


var row = view.findItemByChild(cell),
columnIndex = cell.cellIndex;


if (row && Ext.isDefined(columnIndex)) {


return {
node: cell,
record: view.getRecord(row),
fieldName: me.columns[columnIndex].dataIndex
};
}
}
},