This is a migrated thread and some comments may be shown as answers.

Parsing HTML elements to KendoUI ComboBox in .js file

1 Answer 195 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sriman
Top achievements
Rank 1
Sriman asked on 03 Sep 2014, 12:38 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 04 Sep 2014, 03:26 PM
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!
 
Tags
ComboBox
Asked by
Sriman
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or