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

Adding row after grid sort results in undefined

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 14 Apr 2014, 05:55 PM
If I add a grid row and save it, it works. If I have sorted the column first and then add a row upon saving it shows the data as "undefined". Is there something wrong with my grid configuration?

Here's a link to an example: http://trykendoui.telerik.com/OnUm

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 16 Apr 2014, 09:24 AM
Hello Ryan,

This happens because the range field is undefined. I would recommend adding a check in the template function, for example: 
template : function (data) {
    if (data.range) {
        return data.dirtyFields && data.dirtyFields['range'] ? '<span class="k-dirty"></span> ' + data.range : data.range;
    } else {
        return "";
    }
}


Regards,
Alexander Popov
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
Ryan
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or