I have a grouped Grid in batch mode. My aggregates aren't refreshing as edits are made to the aggregated data until after a .saveChanges is performed. I want the aggregate to update as soon as the focus leaves a cell that is aggregated.
My Columns look like this:
columns.Bound(c => c.Period1)
.HeaderTemplate("<a>" + @title1 + "<br>" + @title2 + "</a>")
//.ClientGroupHeaderTemplate("#= sum #")
.ClientGroupFooterTemplate("#= sum #")
.ClientFooterTemplate("#= sum #")
.Filterable(false)
.Width(100);
My Datasource is configured as such:
.DataSource(dataSource => dataSource
.Ajax()
.AutoSync(false)
.Aggregates(aggregates =>
{
if (Model.Count() > 0) { aggregates.Add(p => p.Period1).Sum(); }
//more aggregate properties here
})
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Group(groups => groups.Add(p => p.ProjectType))
.Model(model =>
{
model.Id(prop => prop.ID);
//other model properties here
})
.Create(create => create.Action("CreateManpowerProjectEstimates", "Manpower"))
.Read(read => read.Action("ReadManpowerProjectEstimates", "Manpower"))
.Update(edit => edit.Action("UpdateManpowerProjectEstimates", "Manpower"))
.Destroy(delete => delete.Action("DestroyManpowerProjectEstimates", "Manpower"))
.PageSize(20)
)