Disable multi-selection?

Is there a way to disable multi select?

+6
javascript slickgrid
source share
5 answers

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

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

Using this option, clicking while holding ctrl or shift does nothing, and it’s undesirable, you cannot deselect a cell using Ctrl + click or click the selected cell again

+9
source share

I do not know any settings 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 ] ] ); } 
+7
source share

Remove muiltiple="multiple" in the following line:

 <select id="id" name="name" multiple="multiple"> 

So, this is as good as deleting this attribute. I would use jQuery.

0
source share

with this code you can disable multiselect:

 document.getElementById('mySelectBox').removeAttribute("multiple");; 

... of the selected selectbox:

 <select multiple="multiple" id="mySelectBox"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> 

(not verified)

0
source share

As for your question, is disabling multiple selection easy enough? Is not it?

 <select multiple="multiple" disabled = "true"> <option value="1"> One <option value="2"> Two <option value="3"> Three </select> 
-2
source share

All Articles