Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9179249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:45:08+00:00 2026-06-17T17:45:08+00:00

I am using an editor template to display a dropdown list via popup for

  • 0

I am using an editor template to display a dropdown list via popup for a Kendo grid. The initial query to fill the grid uses /?$expand=ContactType, where ContactType is a lookup value and Contact is the parent record. This works fine and the grid displays the correct data and associated ContactType. Clicking on edit also works as I have defined an editor template to display the dropdown and the correct value in the dropdown is selected.

However my problem is in adding a new record. When I click add I get

ContactType is undefined.

This make sense as ContactType is not explicitly defined in the datagrid’s datsource schema since I am using expand. I can add ContactType to the model definition, no problem, and the error goes away – but when sending the update ContactType is an empty string and not picking up the actual selected value. ContactType is a related entity to Contact and from my understanding you cannot define a Model with related entities they do have HierarchicalDataSource but that only works with treeview.

So given a dropdown list in a popup editor for a grid, how do you get the Add new to send the selected dropdown value?

Here is some code, TIA for any help

<script id="popup_editor" type="text/x-kendo-template">
    <div class="k-edit-label">
    <label for="firstName">First Name</label>
    </div>
    <input type="text" name="firstName"  data-bind="value:firstName" />

    <div class="k-edit-label">
    <label for="middleName">Middle Name</label>
    </div>
    <input type="text" name="middleName"  data-bind="value:middleName" />

    <div class="k-edit-label">
    <label for="lastName">Last Name</label>
    </div>
    <input type="text" name="lastName"  data-bind="value:lastName" />

    <input name="ContactType" data-source="myDropdownDS" data-text-field="name"
    data-value-field="__KEY" data-bind="value:ContactType.__KEY" data-role="dropdownlist" />
</script>

<script>

    //Local
    var crudServiceBaseUrl = "http://127.0.0.1:8081/cors/";
    var myGridDS = new kendo.data.DataSource({
        type : "json",
        transport : {
            read : {
                url : crudServiceBaseUrl + "Contact" + "/?$expand=ContactType",
                dataType : "json",
                type : "GET",
                complete : function(jqXHR, textStatus) {
                    textStatus = "read";
                }
            },
            update : {
                url : crudServiceBaseUrl + "Contact" + "/?$method=update",
                dataType : "json",
                type : "POST",
                complete : function(jqXHR, textStatus) {
                    textStatus = "update";
                }
            },
            destroy : {
                url : crudServiceBaseUrl + "Contact" + "/?$method=delete",
                type : "GET",
                complete : function(jqXHR, textStatus) {
                    textStatus = "destroy";
                }
            },
            create : {
                url : crudServiceBaseUrl + "Contact" + "/?$method=update",
                dataType : "json",
                type : "POST",
                complete : function(jqXHR, textStatus) {
                    textStatus = "create";
                }
            },
            errors : function(response) { 
                var errorData = $.parseJSON(e.responseText);
                alert(errorData.errorMessage);
                //$("#loading").innerHtml = "error";
            },
            parameterMap : function(options, operation) {
                if (operation == "create") { 
                    return JSON.stringify({
                        "__ENTITIES" : options.models
                    });
                } else if (operation == "update") { 
                    var isEdit = true
                    var myParentEntity = "Contact"
                    var myData = options.models[0];
                    //uri gets added after first edit from Wakanda response, not needed and causes update to fail so delete
                    // delete myData.uri;
                    //

                    configureDataRowRelations(myParentEntity, myData, isEdit)
                    return JSON.stringify({
                        "__ENTITIES" : options.models
                    });
                }

            }
        },
        serverPaging : true,
        serverSorting : true,
        serverFiltering : true,
        batch : true,
        pageSize : 30,
        schema : {
            model : {
                id : "__KEY",
                fields : {
                    __KEY : {
                        type : "string"
                    },
                    __STAMP : {
                        type : "number"
                    },
                    ID : {
                        editable : false,
                        nullable : true
                    },
                    firstName : {
                        type : "string",
                        validation : {
                            required : true
                        }
                    },
                    middleName : {
                        type : "string"
                    },
                    lastName : {
                        type : "string",
                        validation : {
                            required : true
                        }
                    },
                    ContactType : {}
                }
            },
            data : "__ENTITIES"
        }
    });

    var myDropdownDS = new kendo.data.DataSource({
        type : "json",
        transport : {
            read : {
                url : crudServiceBaseUrl + "ContactType",
                dataType : "json",
                type : "GET",
            }
        },
        batch : true,
        pageSize : 30,
        schema : {
            model : {
                id : "__KEY",
                fields : {
                    __KEY : {
                        type : "string"
                    },
                    __STAMP : {
                        type : "number"
                    },
                    ID : {
                        editable : false,
                        nullable : true
                    },
                    name : {
                        type : "string",
                        validation : {
                            required : true
                        }
                    }
                }
            },
            data : "__ENTITIES"
        }
    });



    $('#PopupContactContactTypeGrid').kendoGrid({
        selectable : "row",
        filterable : true,
        pageable : true,
        sortable : true,
        dataSource : myGridDS,
        toolbar : ["create"],
        columns : [{
            field : "ID"
        }, {
            field : "firstName",
            title : "First Name"
        }, {
            field : "middleName",
            title : "Middle Name"
        }, {
            field : "lastName",
            title : "Last Name"
        }, {
            field : "ContactType.name",
            title : "Contact Type"
        }, {
            command : ["edit", "destroy"],
            title : "&nbsp;",
            width : "210px"
        }],
        editable : {
            mode : "popup",
            template : $("#popup_editor").html()
        },

    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:45:09+00:00Added an answer on June 17, 2026 at 5:45 pm

    If the value is not populated to the input in your case this, could be caused by using a name different than the field name

    So I changed data-bind="value:ContactType.__KEY"
    to data-bind="value:ContactType"

    Because of lack of good docs and examples which is not usually an issue with Telerik, this has taken a long time to solve.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display a view model using an editor template that wraps the
I am using an editor template to display a checkbox for each role a
I'm using editor from Kendo UI, so I have big problem. I don't know
I'm using an Editor Template, the syntax in the view looks like this: Html.EditorFor(m
I have created this editor template: @model DateTime? @using MyMvcApp.Properties <div id=dateTimePicker_@(ViewData.ModelMetadata.PropertyName)> <script type=text/javascript
I´m using NSIS editor to make a setup for my application, but I don´t
I'm using markdown editor in my app. $(document).ready(function () { var converter = Markdown.getSanitizingConverter();
I'm using Aloha editor for editing content on a website powered by PHP and
I am using TinyMCE Editor Extender and trying to show the text on clicking
I am making a text editor using Java swing. I am using JTextArea for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.