Skip to content

Commit 5a5acd2

Browse files
committed
selection.grid.CellColumnModel: onCellClick() => add deselection logic #6678
1 parent e532916 commit 5a5acd2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/selection/grid/CellColumnModel.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ class CellColumnModel extends CellModel {
3232
* @param {Object} data
3333
*/
3434
onCellClick(data) {
35-
let me = this,
36-
{view} = me,
37-
cellId = data.data.currentTarget;
35+
let me = this,
36+
{view} = me,
37+
cellId = data.data.currentTarget,
38+
dataField = cellId && view.getDataField(cellId);
3839

39-
if (cellId) {
40-
me.selectedColumns = [view.getDataField(cellId)];
40+
if (dataField) {
41+
me.selectedColumns = me.isSelected(cellId) ? [] : [dataField];
4142
view.createViewData(true)
4243
}
4344

0 commit comments

Comments
 (0)