KendoUI not handling ID with special characters

3 posts, 0 answers
  1. I. Breukink
    I. Breukink avatar
    24 posts
    Member since:
    Dec 2008

    Posted 16 Sep 2013 Link to this post

    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. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 18 Sep 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. I. Breukink
    I. Breukink avatar
    24 posts
    Member since:
    Dec 2008

    Posted 19 Sep 2013 Link to this post

    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
Back to Top