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

Kendo Grid Batch Editing initialise with no data

2 Answers 208 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kalyan
Top achievements
Rank 1
Kalyan asked on 07 May 2012, 01:50 PM
Hi,
I need to create a editable kendo grid - Batch eiditing , which adds/removes a row . Here i acheived it with kendo grid- batch editing as mentioned in the demo. My requirment is something like i need to initialize the grid with no data . But i was not able to do it & hence giving some sample data to initialise it. But i need the grid with an empty data but only with the header with options to add record. Also if i delete all the grid rows & try to add the first row then it is giving me error "Microsoft JScript runtime error: Unable to get value of the property 'id': object is null or undefined" , attaching the screenshot of the same.
Kindly help me out in resolving the creation of grid with no data .

Here goes my code :
var data = [
                {
                    Company: "Spark Tech",
                    Country: "USA"
                }

            ];

                $j("#ComapnyDetailsGrid").kendoGrid({
                    dataSource: {
                        data: data,
                        batch: true,
                        pageSize: 30,
                        schema: {
                            model: {
                                fields: {
                                    Company: { validation: { required: true} },
                                    Country: { type: "string" }

                                }
                            }
                        }
                    },
                    editable: true,
                    toolbar: ["create", "save", "cancel"],
                    columns: [
                  { field: "Company", title: "Company*" },
                  { field: "Country", title: "Country" },
                  {
                      command: "destroy"
                  }
                ]
                });



Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Kalyan
Top achievements
Rank 1
answered on 16 May 2012, 11:31 AM
Kindly someone help me out in this regard.
Thanks,
Kalyan.
0
Kalyan
Top achievements
Rank 1
answered on 26 Jul 2012, 09:08 AM
keeping data:null
will solve the issue .
Tags
Grid
Asked by
Kalyan
Top achievements
Rank 1
Answers by
Kalyan
Top achievements
Rank 1
Share this question
or