CommandItem enable/disable SaveButton dynamically

4 posts, 1 answers
  1. mathieu
    mathieu avatar
    2 posts
    Member since:
    Apr 2016

    Posted 27 Mar 2019 Link to this post

    Hi community,

     

    I have a radgrid in batch mode bound to a list of tests. The user has to select 1 to n rows by checking checkboxes.

    Then, I have a javascript function (CheckRequirement) that checks the consistency of the selected rows (ie.: test1 require test2).

    What I need to do is enable/disable the SaveButton depending on the CheckRequirement function result.

     

    Any idea to do this on client side?

     

  2. Answer
    Vessy
    Admin
    Vessy avatar
    2367 posts

    Posted 01 Apr 2019 Link to this post

    Hi Mathieu,

    The Grid does not expose an API for controlling the command item buttons externally, but you can achieve that by disabling the mouse-pointer events of the Save button with a similar jQuery logic:
    $telerik.$(".RadGrid button.rgSave").css('opacity', 0.5).css("pointer-events", "none");
     
    //enable
    //$telerik.$(".RadGrid button.rgSave").css('opacity', 1).css("pointer-events", "auto");


    Regards,
    Vessy
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. mathieu
    mathieu avatar
    2 posts
    Member since:
    Apr 2016

    Posted 05 Apr 2019 in reply to Vessy Link to this post

    Exactly what I needed.

    Thank you Vessy

  4. Vessy
    Admin
    Vessy avatar
    2367 posts

    Posted 05 Apr 2019 Link to this post

    Hello,

    You are welcome, mathieu - I am glad I managed to help :)

    Regards,
    Vessy
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top