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

Disabled button press styling

3 Answers 1653 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 13 Jun 2012, 09:22 AM
To create a disabled button, which should not be clickable, I am using the code:
<div class="k-button k-state-disabled">Disabled Button</div>
This works great, however, it would be preferable if on click it would not change the text colour to white.

Thanks

3 Answers, 1 is accepted

Sort by
0
Sandeep
Top achievements
Rank 1
answered on 05 Feb 2013, 10:32 AM
You can set the 

Pointer-events : none

to disable all pointer actions on that element.
0
Ron
Top achievements
Rank 1
answered on 18 Sep 2020, 10:02 AM

use prop("disabled", true) on your div so give it an id, so you can address it with $("#id") in javascript.

0
Nikolay
Telerik team
answered on 23 Sep 2020, 09:20 AM

Hi,

Thank you for sharing this approach with the community. I believe it will be helpful to others facing the same scenario.

Indeed, it is a valid one. I can also suggest disabling the button via enable() method that will automatically append .k-state-disabled class and will remove pointer events:

<button id="button" type="button">Edit</button>
<script>
    $("#button").kendoButton();
    var button = $("#button").data("kendoButton");
    // disable button
    button.enable(false);
</script>

Regards,
Nikolay
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Sandeep
Top achievements
Rank 1
Ron
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or