Disable toolbar button on kendo ui grid

1 Answer 4529 Views
Grid
Alexis
Top achievements
Rank 1
Alexis asked on 29 Mar 2012, 06:36 AM
hi,

I have a kendo ui grid with toolbar ( with save button ) specified. Not i want to disable the button if the grid contains nothing and when the user clicks it since i'm in the process of processing the request to the server. It is possible? How can i do it? Thanks
Kyle
Top achievements
Rank 1
commented on 03 Apr 2012, 07:22 PM

Did you ever get this figured out? I'm trying to do something similar.
Alexander Valchev
Telerik team
commented on 04 Apr 2012, 01:17 PM

Hi guys,

This functionality is not supported out of the box. A possible solution would be to cover the button with a transparent <div> element and remove it on the dataBound event. In this jsFiddle you can find a working example showing this approach in action.
I hope this information will help.

All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Sanket
Top achievements
Rank 1
commented on 08 Apr 2013, 11:43 AM

This functionality needs to be supported,can we expect any such thing in near future.
Stefan Timm
Top achievements
Rank 2
commented on 03 Sep 2013, 01:55 PM

Please can you check the fiddle:  http://jsfiddle.net/valchev/W3fqH/
This is not working. The #myCover is not hiding

regards Stefan Timm

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 03 Sep 2013, 03:09 PM
Hi everyone,

You can make the button look disabled by adding a "k-state-disabled" class, however clicking it will still add a new row. You can get around that too by removing the "k-grid-add" class. Here is an example
 

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Rubens
Top achievements
Rank 2
commented on 23 Nov 2016, 05:01 AM

It might be important to consider that if you by chance are rendering your Grid Widget using MVC Wrappers, you also should remove "ahref" atribute from "k-grid-add" in order to avoid the click.

$(".k-grid-add")
    .removeClass("k-grid-add")
    .addClass("k-state-disabled")
    .removeAttr("href");
Tags
Grid
Asked by
Alexis
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or