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

Grid Total not showing correct value after remove + add

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shaneed
Top achievements
Rank 1
shaneed asked on 23 Apr 2014, 10:50 AM
When I remove and then add a row in the Kendo grid, it increments the value by 1 instead of showing the same number of rows.

For eg, if I have only one row,

var dataSource1 = $("#grid").data("kendoGrid").dataSource;
a =dataSource1.data()[0];
dataSource1.remove(a)
alert("Total after removing a row : " + dataSource1.total()) // Now this is 0
dataSource1.add("Total after adding the same row" + a)
alert(dataSource1.total()) // Now this gives 2?!?!?!

But looking into the grid.dataSource.data().length gives the correct value of 1.
Due to this, the number of records present in the table shown in the table footer is displayed incorrectly.() It is shown as (1 - 2 of 2 records, instead of 1-1 of 1 record)

This also works for removing and adding multiple rows.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 24 Apr 2014, 10:57 AM
Hi shaneed,

We were able to observed the issue you have described and to address it. The fix will be available with the next internal build. Meanwhile, I have updated your telerik points.

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