I have an EditorTemplate with a ComboBox which is bound (via matching Name) to a property in my Model. The ComboBox is populated with some custom data objects via

.Name("MyType"
.DataTextField("Name")
.DataValueField("DBValue")
.DataSource( source => 
{
    source.Read( read => { read.Action( "GetTypes", "MyController" ); } );
} )

I put a breakpoint at the click of the Submit button, and checked $('#MyType').val( ). It had a legitimate value ('ABC'). The value in the Model at this time was null. I put another breakpoint in the Controller at the Update action. At this point, the value in the Model was the string, '[object Object]'. This only seems to happen when the original value in the Model is null, but it is consistent when that is the case. Whenever the value in the Model is not null, even if it is '[object Object]', the next time I update it with the ComboBox, it stores the correct value.

What can I do to make sure the value from the ComboBox gets passed to the Update?

有帮助吗?

解决方案

Apparently, as of this date, Kendo has a problem with ComboBoxes whose data-bound property is null, and their suggested work-around is to make sure the data-bound property is, in fact, not null. They are aware of this and are looking to provide for it in a later release.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top