pass server side variables into client footer template funcitons
Currently, there's no way to pass variables into client footer template functions that are registered with client footer templates.
@foreach @foreach (var model in Model.MyModels)
.Name("ModelGrid_" + @model.ID)
columns.Bound(m => m.Name).Width(30).ClientFooterTemplate("#= footerLabel(data) #");
columns.Bound(m => m.Hours).Width(30).ClientFooterTemplate("#= HoursSumAvg_" + @model.ID + "(data) #");
columns.Bound(m => m.Weight).Width(30).ClientFooterTemplate("#= WeightSumAvg_" + @model.Weight + "(data) #");
@foreach(var modelID in Model.ModelIDs)
var hourFunction = "function HoursSumAvg_" + modelID + "(model) ";
var grid_name = '#FlowPlanDetailsGrid_@modelID';
This quickly becomes a mess if you have a for loop that renders 5 or 10 grids, as we have the use-case for.
Alternatively, if the client footer template functions could somehow retain the name of the grid they are bound to, via a property in the parameter passed in, that would be good enough.