Cannot disable menuButtons of splitButton

5 posts, 0 answers
  1. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 08 Dec 2014 Link to this post

    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).
  2. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 09 Dec 2014 Link to this post

    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.
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 09 Dec 2014 Link to this post

    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!
     
  5. Thomas
    Thomas avatar
    12 posts
    Member since:
    Jul 2013

    Posted 28 Sep 2015 in reply to Alexander Valchev Link to this post

    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

  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 30 Sep 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready