Disable toolbar button on kendo ui grid

7 posts, 0 answers
  1. Alexis
    Alexis avatar
    5 posts
    Member since:
    Feb 2012

    Posted 29 Mar 2012 Link to this post

    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
  2. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 03 Apr 2012 Link to this post

    Did you ever get this figured out? I'm trying to do something similar.
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 04 Apr 2012 Link to this post

    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!
  5. Sanket
    Sanket avatar
    11 posts
    Member since:
    Apr 2013

    Posted 08 Apr 2013 Link to this post

    This functionality needs to be supported,can we expect any such thing in near future.
  6. Stefan Timm
    Stefan Timm avatar
    6 posts
    Member since:
    May 2007

    Posted 03 Sep 2013 Link to this post

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

    regards Stefan Timm
  7. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 03 Sep 2013 Link to this post

    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!
  8. RMC
    RMC avatar
    3 posts
    Member since:
    Mar 2011

    Posted 22 Nov Link to this post

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