While working on a recent project I came across a need to sum a specific column of the Kendo UI Grid in my application after it loaded. Specifically, I had a grid where one column of each row was the “Percent of Total”. What the client requested, was that a message be displayed at the top of the screen whenever the sum of that column in all the rows of the grid did not equal 100%.
My first thought, was that I would handle this server side. I could calculate the sum before I ever sent the data to the view. Drop that sum in ViewData and I would be off to the races.
The problem with this approach is that in this project I was utilizing the excellent inline edit capabilities of the Kendo UI Grid. This meant that the user could add a new row without the screen refreshing. Without that server round trip, I could not be sure what I was showing the user was correct. I needed something client side!
Read more