protected internal virtual void RegisterCalculations()
{
if (this.Calculations.Count == 0)
{
return;
}
StringBuilder sb = new StringBuilder();
sb.Append("Ext.apply(Ext.grid.GroupSummary.Calculations,{");
bool comma = false;
foreach (JFunction f in this.Calculations)
{
if (f.Name.IsEmpty())
{
throw new Exception("You have to define Name for GroupingSummary calculation function");
}
if (comma)
{
sb.Append(",");
}
f.Args = new string[] { "v", "record", "field", "data" };
sb.Append(f.ToScript());
comma = true;
}
sb.Append("});");
this.AddScript(sb.ToString());
}