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

Grid, Add new record crashes when having a filter that filters all rows

4 Answers 242 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bert
Top achievements
Rank 1
Bert asked on 15 Dec 2011, 10:57 AM
Add new record crashes when having a filter that filters all rows
See sample below.
Steps to reproduce;
1) In the grid, set filter to First Name = "xyz" , result:  all records filtered.
2) Press Add new record button , result:
    Microsoft JScript runtime error: Unable to get value of the property 'ID': object is null or undefined

<div id="grid">
</div>
<script type="text/javascript">
    $(document).ready(function () {

        var ds = new kendo.data.DataSource({
            schema: {
                model: {
                    id: "ID",
                    fields: {
                        ID: { type: "number", editable: false, nullable: true },
                        FirstName: { type: "string" },
                        LastName: { type: "string" }
                    }
                }
            },
            data: [
                         { ID: "1", FirstName: "Joe", LastName: "Smith" },
                         { ID: "2", FirstName: "Jane", LastName: "Hilton" }
                      ]
        });

        $("#grid").kendoGrid({
            dataSource: ds,
            columns: [
                        { field: "ID", title: "ID" },
                        { field: "FirstName", title: "First Name" },
                        { field: "LastName", title: "Last Name" }
                     ],
            toolbar: ["create", "save", "cancel"],
            editable: true,
            navigatable: true, // tab thru the cells
            autoBind: true,
            sortable: true,
            filterable: true,
            scrollable: false
        });

    });
</script>

4 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 15 Dec 2011, 03:34 PM
Hi Bert,

Indeed, we are already aware of this issue and I have attached an internal build which should address it.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
James Lamar
Top achievements
Rank 1
answered on 19 Dec 2011, 04:40 PM
Kudos to Kendo.
Rosen, you're the man! unless you're a woman...in which case I would ask you to marry me, but I'm already married.
0
teomrd
Top achievements
Rank 1
answered on 09 Jan 2013, 09:37 AM
I cannot see how the internal build solves the problems. Is there an exampe, which a grid has the ability to "add new record" and filter its records  simultaneously? Beacuse i cannot find it.. 
0
Rosen
Telerik team
answered on 10 Jan 2013, 02:32 PM
Hello teomrd,

The internal build does address the issue which Bert describes. However, indeed, if you are adding a record which does not match the filter, it will not be displayed in the result as it does not match the condition.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Bert
Top achievements
Rank 1
Answers by
Rosen
Telerik team
James Lamar
Top achievements
Rank 1
teomrd
Top achievements
Rank 1
Share this question
or