Ben Clark
Ben Clark

Reputation: 31

Dropdown within Kendo Grid in Form > Add New Record Creates Uninitialized Cell

I am trying to create a Kendo grid with dropdown templates in cells users can submit as part of a form, using these two articles:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-dropdownlist-column-template https://docs.telerik.com/kendo-ui/knowledge-base/grid-submit-with-form

The dropdowns look good when they bind to the data, but when adding a new record or modifying an existing one, they quickly break and become text inputs.

Here's my code. https://dojo.telerik.com/@ben-clark/uREGoBUD

Any ideas?

Upvotes: 2

Views: 563

Answers (2)

Ben Clark
Ben Clark

Reputation: 31

There were a few problems with my initial attempt.

  1. I needed to add RowID values to the existing selected values.
  2. I needed to prevent going into the 'edit' mode automatically on new rows.
    // in the grid object
    beforeEdit: function(e){
        if (!e.model.isNew()) {
        e.preventDefault();
      }
    }

Huge credit to @CarlosMartins for the abstract comment.

Solution code: https://dojo.telerik.com/@ben-clark/uREGoBUD/10

Upvotes: 1

user11809641
user11809641

Reputation: 895

Just remove the line editable: "incell", from your grid object and it will work!

Upvotes: 0

Related Questions