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

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

3 Answers 114 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
VasVas
Top achievements
Rank 1
VasVas asked on 18 Jul 2013, 08:11 AM
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




3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Jul 2013, 07:51 AM
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!
0
VasVas
Top achievements
Rank 1
answered on 22 Jul 2013, 11:30 AM
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
0
Daniel
Telerik team
answered on 24 Jul 2013, 08:01 AM
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!
Tags
ComboBox
Asked by
VasVas
Top achievements
Rank 1
Answers by
Daniel
Telerik team
VasVas
Top achievements
Rank 1
Share this question
or