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

[Solved] Angular Kendo Grid- Issue with DropDown

1 Answer 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shreesh
Top achievements
Rank 1
Shreesh asked on 17 Nov 2014, 08:07 AM
Hello,

How do I receive a dropdown list Id in a Create method of the Controller? My drop list is a CategoryList and I want CategoryId. I am trying to keep my Product model flat as nesting with complex object (like Category) also did NOT work.
Let me know, whether my ParameterMap  is correct and how do I write it for a complex object, if I want to embed it ?


However,  I can get CategoryId in my Update method. Please let me how to correct the above issue?

Attached are files in a zip.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Nov 2014, 09:01 AM
Hello Shreesh,

The problem will occur on create because the field is not defined in the model and its value will be undefined for new items. In this case the field will be bound as object and the value posted to the server will not be bound. Using the valuePrimitive option for the dropdownlist
.appendTo(container)
.kendoDropDownList({
    valuePrimitive: true,
    ...

or defining the field in the model:
model: {
    id: "ProductId",
    fields: {
        CategoryId: {type: "number"},
        ...


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Shreesh
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or