How to set all Kendo components within a Div to readonly

2 posts, 0 answers
  1. JP13
    JP13 avatar
    16 posts
    Member since:
    Sep 2018

    Posted 23 May 2019 Link to this post

    I have a div that has 7 different elements that I want to make readonly.  Right now I have the following script that is setting all non kendo items to readonly

    $("#GroupBox").find('input, label').attr("readonly", true)

     

    I have 4 dropdownlists, 2 sliders, and 1 datepicker that I also want to make readonly.  I know that I can set each of them individually, but is there an easier way? something similar to what I can do for non kendo component?

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 28 May 2019 Link to this post

    Hello Jed,

    Following is a dojo example with a possible implementation for achieving the desired behavior:
    I have created a function that accepts the container element and "true" or "false" as a second parameter. The function will make all nested Kendo widgets in the container readonly (if the second parameter is "true").

    Hope this helps.


    Regards,
    Konstantin Dikov
    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