Unable to get property 'data' error while updating Grid

2 posts, 0 answers
  1. Naga
    Naga avatar
    25 posts
    Member since:
    Jul 2015

    Posted 25 Aug 2015 Link to this post

    Hello, 

    I am trying to update the grid through popup

    I am getting the below error 
    0x800a138f - JavaScript runtime error: Unable to get property 'data' of undefined or null reference
    also if I click the Edit button and again click on cancel in the Edit popup , the record i have used is missing in the grid
    Please help me 
    here is my code.
     dataSource: {
                    type: "json",
                    transport: {
                        read: URL,
                        update: {
                                url: UpdateURL,
                                dataType: "json",
                                type: "POST"
                        },
                        parameterMap: function (data, operation) {
                            if (operation !== "read") {
                                return kendo.stringify(data);
                            }
                        }
                    },
                    requestStart: function(e) {
                        if (e.type == "update") {
                            //My LOGIC
                            debugger;
                        }
                    },

                    schema: {

      type: "json",
      id: "ID",
                        model: {
                            fields: {
                                ID: { type: "number", editable: false},
                                Name: { type: "string", validation: { required: true } },
                                Status: { type: "string" },                            
       Access: { type: "string", nullable: true },
                                Address: { type: "string" },
                                Comment: { type: "string", validation: { required: true } },
                                ParentID: { type: "number", validation: { required: true } },
                                ParentName: { type: "string" },
                            }
                        }
                    },
                    serverPaging: false,
                    serverFiltering: false,
                    serverSorting: false
                },
                height: 550,
                filterable: true,
                sortable: true,
                pageable: {
                    pageSize: 100,
                    refresh: true
                },


                columns: [

                { command: ["edit"], title: " ", width: "100px" },
       { field: "ID", title: "ID", width: "300px" },
                { field: "Name", title: "SubInventory", width: "300px" },
                { field: "Status", title: "Active", width: "75px" },
                { field: "Access", title: "Access", width: "200px" },
                { field: "Address" },
                { field: "Comment", tite: "Comments", width: "250px" },
                { field: "ParentID", title: "ParentName", width: "180px", editor: dropdownforParent}
    ]
                , filterMenuInit: onFilterMenuInitSI,
                editable: "popup",
            }).data("kendoGrid");

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 27 Aug 2015 Link to this post

    Hello Naga,

     

    From the provided code I am not able to tell you why exactly this issue occurs. Would it be possible to extract a small runnable sample that reproduces the issue, so we can take a look and see what happens?

     

    Regards,
    Kiril Nikolov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top