ComboBox().name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))

4 posts, 0 answers
  1. VasVas
    VasVas avatar
    31 posts
    Member since:
    Nov 2012

    Posted 18 Jul 2013 Link to this post

    I have a very complex Model which has multiple objects some of them are lists.
    for example :
    Data.MylistObject[0].StatusID

    when I pass

    var name =  ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty);

    @Html.Kendo().ComboBox().Name(name)

    on the page html the 

    jquery that creates the combo will look like :

    jQuery(function(){jQuery("#Data.MylistObject[\\0\\]_StatusID.kendoComboBox

    but jscript code refrencing the combo written in @ 
    $('[name=@id].data('kendoComboBox')

    is translatet to this code on the page

    $('[name=Data.MylistObject_0__StatusID].data('kendoComboBox')

    this inconsistency causes the code that is ment to taggle the options.filter paramenter to stop working due to the fact that the combo is not selected due to the difference in names.

    the only way I found arround this is to pass  the id to the name property @Html.Kendo().ComboBox().Name(id)

    and use 

    $('#@id].data('kendoComboBox')

    which works , there seems to be a problem with the way kendo parse [0] part of the member name.

    Yours,

    Ariel




  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 22 Jul 2013 Link to this post

    Hello Ariel,

    Since the latest official release the controls should use underscore for the brackets. Which version are you using?

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. VasVas
    VasVas avatar
    31 posts
    Member since:
    Nov 2012

    Posted 22 Jul 2013 Link to this post

    Dear Daniel
    I am using kendo ui Q1 2013 , The Q2 was realesed only a couple of days ago . Does this version contains these changes?

    I will download the new MVC wrapper version and will try it.

    Yours,

    Ariel
  5. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 24 Jul 2013 Link to this post

    Hello again Ariel,

    The changes were made for the Q2 release. Please update the version you are using and let me know how it goes.

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