This is a migrated thread and some comments may be shown as answers.

Allow only single checkbox to be checked at a time

7 Answers 1158 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
jeff
Top achievements
Rank 1
jeff asked on 06 Nov 2014, 11:38 PM
Simple in jQuery, but I haven't figured out to only allow one checkbox checked at a time (used to enable editing a specific user): I'm using the following simple jquery to enable/disable buttons:

                                    function onCheck(e) {
                                        
if ($('input.checkTreeview').is(':checked')) {
                                              $(
'#addUserButton').attr('disabled', 'disabled');
                                              $(
'#modifyUserButton').attr('disabled', false);
                                         }
else {
                                              $(
'#addUserButton').attr('disabled', false);
                                              $(
'#modifyUserButton').attr('disabled', 'disabled');
                                          }

                                    }


Anything I can do here to allow only one checkbox checked at a time?

7 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 07 Nov 2014, 10:04 AM
Hello Jeff,

See this Dojo snippet for a way to show only one checked checkbox.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jeff
Top achievements
Rank 1
answered on 07 Nov 2014, 12:36 PM
Hi Alex,
Thank you for the response, but when I go to the dojo, I'm getting "failed to load snippet", etc.. Please feel free to paste here for the interim, thank you!
0
jeff
Top achievements
Rank 1
answered on 07 Nov 2014, 01:20 PM
Nevermind.. Local network "issues". Anyways, worked lovely, exactly what I was after, thank you!
0
JMB
Top achievements
Rank 1
answered on 13 Dec 2016, 05:00 PM

Hi,

Are you sure this solution still works ? I'm able to lock one single leaf selection at a time, but nodes refuses to be checked because the algorithm uncheck all others checkboxes, so automatically the node gets unchecked.

0
Stefan
Telerik team
answered on 15 Dec 2016, 12:13 PM
Hello  Jean-Marc,

I took the example provided by my colleague Alex and updated it to the latest version of Kendo UI(2016.3.1118) and it is working as expected:

http://dojo.telerik.com/oqADu

Let me know if additional assistance is needed on this matter.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
n/a
Top achievements
Rank 1
answered on 03 Oct 2018, 11:33 PM
I think this should be added as a configuration option under checkboxes.  Maybe something called "singleSelect", that is a boolean. 
0
Neli
Telerik team
answered on 05 Oct 2018, 12:21 PM
Hi Jonathan,

I would suggest you to submit the issue in the Kendo UI Feedback Portal. Depending on the popularity it gain from the comunity, it could be considered for future implementation.

Regards,
Neli
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeView
Asked by
jeff
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
jeff
Top achievements
Rank 1
JMB
Top achievements
Rank 1
Stefan
Telerik team
n/a
Top achievements
Rank 1
Neli
Telerik team
Share this question
or