PDA

View Full Version : Selection Tweak on Grid



TopoFurnier
23 Oct 2012, 11:11 AM
Hi Everyone!
I have this grid and I want to change the way row selections are performed.
I manage the row selection through another widget, to do so I need to have the grid selection enabled.
I want to prevent the user from selecting rows by clicking on it, I cant use disableSelection:true (needed for selecting rows by any mean) I cant disable everyclick on the grid since I want to use the cellediting plugin.

I overrided the onRowMouseDown method on the row selection model with an empty one to disable the selection on click, and it worked quite well except for the cellediting plugin.
When using the cell editing plugin (doesnt mater the number of clicks to edit ), when the edition mode starts the row is selected.

Any idea on how to solve this issue?
Thanks,
Topo.

James Goddard
23 Oct 2012, 11:25 AM
Probably will have to also override the cell editor code that selects in showEditor:



// Select cell on edit only if it's not the currently selected cell
if (sm.selectByPosition && (!selection || selection.column !== context.colIdx || selection.row !== context.rowIdx)) {
sm.selectByPosition({
row: context.rowIdx,
column: context.colIdx,
view: me.view
});
}

TopoFurnier
24 Oct 2012, 6:23 AM
Worked fine,
thanks for the tip.