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

KendoUI not handling ID with special characters

2 Answers 191 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
I. Breukink
Top achievements
Rank 1
I. Breukink asked on 16 Sep 2013, 11:33 AM
If I'm using
<input id="LAYOUTID" />;
$("#LAYOUTID").kendoComboBox();
var comboboxItem = $("#LAYOUTID");
var ds = comboboxItem.data("kendoComboBox");

it is al working fine, i get a valid ds.

Hower if i use a different ID (a valid jquery and html ID), it is not working
<input id="struct:LAYOUTID" />;
$("#struct:LAYOUTID").kendoComboBox();
var comboboxItem = $("#struct:LAYOUTID");
var ds = comboboxItem.data("kendoComboBox");

I get no error, but ds is null and there is no combobox generated. As far as i can see, the problem is the ":" sign.

Is this an error, or are the valid characters different for Kendo. If so, which are valid characters (i would prefer to have some special characters)

Thanks,

Ivor

2 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 18 Sep 2013, 08:00 AM
Hi Ivor,

The problem comes from the fact that jQuery cannot select the element with the mentioned ID. And Kendo UI needs the a jQuery element in order to initialize it as a widget. Please check the following screencast:

http://www.screencast.com/t/dqMUyeoLtVAd

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
I. Breukink
Top achievements
Rank 1
answered on 19 Sep 2013, 03:07 PM
Hi Kiril,

I have solved it. You have to escape the column with  backslahses. This will work.

<input id="struct:LAYOUTID" />;
$("#struct\\:LAYOUTID").kendoComboBox();
var comboboxItem = $("#struct\\:LAYOUTID");
var ds = comboboxItem.data("kendoComboBox");

Thanks

Ivor
Tags
ComboBox
Asked by
I. Breukink
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
I. Breukink
Top achievements
Rank 1
Share this question
or