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

2 posts, 1 answers
  1. Fabio
    Fabio avatar
    24 posts
    Member since:
    Nov 2013

    Posted 13 Apr 2016 Link to this post

    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?

  2. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 15 Apr 2016 Link to this post

    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!
     
Back to Top