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

Cannot disable menuButtons of splitButton

4 Answers 131 Views
Toolbar
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 08 Dec 2014, 05:00 PM
In the following Dojo: http://dojo.telerik.com/agAfU/3
"Add" splitButton is disabled as expected.
"View->Profile" item of splitButton is not disabled (most probably a defect).

4 Answers, 1 is accepted

Sort by
0
Jack
Top achievements
Rank 1
answered on 09 Dec 2014, 08:30 AM
Please confirm the following workaround:
$('#user-toolbar-view-profile').addClass('k-state-disabled');

Just adding the class seems to be enough to disable the call to the click event handler.
0
Alexander Valchev
Telerik team
answered on 09 Dec 2014, 03:45 PM
Hi Jack,

Currently disabling a single menu button of a SplitButton is not supported through the API.

Your workaround is almost valid. In addition you should also add a k-state-disabled class to the button located in the overflow popup (unless you have resizable: false).

$('#user-toolbar-view-profile, #user-toolbar-view-profile_overflow').addClass('k-state-disabled');

IDs receive an _overflow suffix in the overflow popup container.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Thomas
Top achievements
Rank 1
answered on 28 Sep 2015, 10:50 AM

The following workaround is not working for me if I have a click function binded to the "Profile" menu which must be disabled.

I am using Kendo UI 2015 Q2 SP2.

Check the updated code: http://dojo.telerik.com/OMemU

0
Alexander Valchev
Telerik team
answered on 30 Sep 2015, 09:23 AM
Hi Thomas,

In order to prevent the click function to be executed you may prevent the mousedown event. For example:
$('#user-toolbar-view-profile, #user-toolbar-view-profile_overflow').addClass('k-state-disabled').on("mousedown", function(e) { e.stopImmediatePropagation(); });


Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Toolbar
Asked by
Jack
Top achievements
Rank 1
Answers by
Jack
Top achievements
Rank 1
Alexander Valchev
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or