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

drop down list Error "0x800a138f - JavaScript runtime error: Unable to get property 'CD_PLANT' of undefined or null reference"

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fabio
Top achievements
Rank 1
Fabio asked on 13 Apr 2016, 09:41 AM

In my grid I use the popup editing with a drop down list, when i edit an existing row i don't have any problem, but when i want to add a new row andi click on a value of the drop down list i get this error:

"0x800a138f - JavaScript runtime error: Unable to get property 'CD_PLANT' of undefined or null reference"

 

This is the template for the popup:

 

<script type="text/x-kendo-template" id="popup_editor">

<div class="k-edit-label" >
            <label for="CD_PLANT" style="font-weight:normal">
                plant
            </label>
</div>
<div data-container-for="CD_PLANT" class="k-edit-field" >           
            <input kendo-drop-down-list k-data-source="lineCtrl.Plants"
                   k-data-value-field="'CD_PLANT'"
                   k-data-text-field="'DS_PLANT'"
                   data-bind="value: PLANT.CD_PLANT"/>   

 </div>

</script>

 

 

What is the problem? How can i solve it?

1 Answer, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 15 Apr 2016, 06:39 AM

Hello Fabrizio,

Most probably the column is bound to a complex property (the type of the model property is a custom object). If this is the case a default value in the schema.model configuration should be set. Please refer to the Grid / Editing custom editor demo and take a look at the Category field. 

Category: { defaultValue: { CategoryID: 1, CategoryName: "Beverages"} },

Regards,
Boyan Dimitrov
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
Fabio
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or