Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable multi select?

Is there a way to disable multi select?

like image 952
Tom Avatar asked Aug 20 '10 01:08

Tom


2 Answers

I know this is an old question, but updates to Slickgrid now allow you to disable multiSelect in the grid options:

var options = {
            editable: false,
            enableCellNavigation: true,
            asyncEditorLoading: false,
            multiSelect: false
        };

With this option, clicking while holding a ctrl or shift does nothing, and undesirably, you cannot deselect a cell with ctrl + click, or clicking the selected cell again

like image 139
pclem12 Avatar answered Sep 29 '22 08:09

pclem12


In don't know of any setting to disable it.

handle the onSelectedRowsChanged event and do something like:

var selectedRows = grid.getSelectedRows();
if( selectedRows.length > 1 ) {
  grid.setSelectedRows( [ selectedRows[ selectedRows.length - 1 ] ] );
}
like image 43
Chris Hogan Avatar answered Sep 29 '22 09:09

Chris Hogan