Parsing HTML elements to KendoUI ComboBox in .js file

2 posts, 1 answers
  1. Sriman
    Sriman avatar
    4 posts
    Member since:
    Sep 2012

    Posted 03 Sep 2014 Link to this post

    Hi,

    I am trying to get all controls on the page using $(document).getElementsByTagName("*") and set attributes like ReadOnly and Visibility based on defined permissions for each control.

    In the result of $(document).getElementsByTagName("*") I noticed that I get three elements for one KendoUI ComboBox...

    Element 1
    <span class="k-widget k-combobox k-header FundFeeChangedDataIvan"><span class="k-dropdown-wrap k-state-default" tabIndex="-1" unselectable="on"><input aria-disabled="false" style="width: 100%;" aria-expanded="false" aria-readonly="false" class="k-input FundFeeChangedDataIvan" role="combobox" tabIndex="0" aria-owns="ddlTiming_listbox" name="ddlTiming_input" type="text" autocomplete="off" aria-autocomplete="list"><span class="k-select" tabIndex="-1" unselectable="on"><span class="k-icon k-i-arrow-s" role="button" tabIndex="-1" aria-controls="ddlTiming_listbox" unselectable="on">select</span></span></span><input aria-disabled="false" style="display: none;" id="ddlTiming" aria-readonly="false" class="FundFeeChangedDataIvan" name="ddlTiming" type="text" data-role="combobox"></span>

    Element 2
    <input aria-disabled="false" style="width: 100%;" aria-expanded="false" aria-readonly="false" class="k-input FundFeeChangedDataIvan" role="combobox" tabIndex="0" aria-owns="ddlTiming_listbox" name="ddlTiming_input" type="text" autocomplete="off" aria-autocomplete="list">

    Element 3
    <input aria-disabled="false" style="display: none;" id="ddlTiming" aria-readonly="false" class="FundFeeChangedDataIvan" name="ddlTiming" type="text" data-role="combobox">

    How can I determine the set of elements that belong to one KendoUI ComboBox and also parse them into a KendoUI ComboBox in .js file to set attibutes such as ReadOnly and Visibility.

    Note: I have also used $(document)[0].getElementsByClassName('FundFeeChangedDataIvan') and the result is still same.

    Thanks
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 04 Sep 2014 Link to this post

    Hello Sriman,

    >> "How can I determine the set of elements that belong to one KendoUI ComboBox..."

    The set of elements that belong to a Kendo UI widget consists of all elements inside the widget wrapper. In this case the ComboBOx wrapper is <span class="k-widget k-combobox">

    >> "...and also parse them into a KendoUI ComboBox..."

    I am not sure what do you mean by "parse", but generally, you can obtain reference to the widget instance like this:

    http://docs.telerik.com/kendo-ui/basics/events-and-methods#obtain-a-reference-to-the-kendo-ui-widget-instance-using-jquery

    "... to set attibutes such as ReadOnly and Visibility."

    I have provided some relevant information here:

    http://www.telerik.com/forums/implementing-control-level-security-permissions

    Please do not post duplicate forum threads or support tickets.

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top