I'm using the Aggregates feature of a Kendo UI Grid Widget to display the sum of a grouped column. The column in question is bound to an optional field / property so when the data set includes a data item where property is not present (i.e. undefined), the sum ends up being NaN as you would expect.
The Kendo DataSource calculates these aggregates "when the data source populates with data" but does not include a feature to allow custom aggregates that would allow me to implement a version of sum that substitutes 0 for undefined values.
I can see where the sum aggregate function is defined in kendo.data.js but I would prefer not to change that if possible.
I have an idea how to solve this by writing a function to query the $("#myGridId").data("kendoGrid").dataSource
but I'd like to know if there is a better option.