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

Accessing kendoDropDownList object for PUT

1 Answer 56 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Brent asked on 15 Sep 2015, 04:40 PM

I am currently using WebAPI and KendoUI (drop down in this example). When I need to the object to the API I grab the object out of the data source. To get the selected item I use:

var ​dataItem= $("#dropDown").data("kendoDropDownList").dataItem();

Then to make the object valid I have to remove kendo's ID like so:

delete dataItem.$id

After this I can JSON.stringify the object to pass to the API via ajax:

    type: "PUT",
    url: BASE + "Api/MyController",
    data: JSON.stringify(dataItem),
    contentType: "application/json",
    success: function () {
    error: function (result) {


Is this bad practice? Is there a better way of getting the object from the data source instead of deleting kendoui's $id every time?

1 Answer, 1 is accepted

Sort by
Kiril Nikolov
Telerik team
answered on 17 Sep 2015, 07:55 AM

Hello Brent,

The dataItem() method will always return the full data item including the ID. There is no method that will return the dataItem without the ID field unfortunately. 

Kiril Nikolov
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question