model view controller - I cannot get the Telerik MVC extensions grid to show a total with ClientFooterTemplate -
i using ajax binding , assuming if want total update after user edits change, need clientfootertemplate opposed footertemplate works.
here grid works footertemplate:
@{ grideditmode mode = (grideditmode)viewdata["mode"]; gridbuttontype type = (gridbuttontype)viewdata["type"]; gridinsertrowposition insertrowposition = (gridinsertrowposition)viewdata["insertrowposition"]; html.telerik().grid<redfile.models.quickquoteitemview>("items") .name("quoteitems") .datakeys(k => k.add(o => o.id)) .toolbar(commands => commands.insert().buttontype(type).imagehtmlattributes(new { style = "margin-left:0" })) .columns(c => { c.bound(o => o.id).readonly().hidden(); c.bound(o => o.itemid); c.bound(o => o.description); c.bound(o => o.itemqty); c.bound(o => o.itemprice).format("{0:c}"); c.bound(o => o.linetotal) .width(100) .aggregate(ag => ag.sum()) .footertemplate(result => (result.sum == null ? "0.00" : result.sum.format("{0:c}"))) .format("{0:c}"); c.command(s => { s.edit(); s.delete(); }); }) .editable(editing => editing.mode(mode).insertrowposition(insertrowposition)) .databinding(b => b.ajax() .select("gridselect", "quickquote") .insert("gridinsert", "quickquote", new { qqid = model.id }) .update("gridupdate", "quickquote", new { qqid = model.id }) .delete("griddelete", "quickquote", new { qqid = model.id }) ) .footer(true) .render(); }
if change footer template this: (i have tried multiple variations same result)
.clientfootertemplate("<#= $.telerik.formatstring('{0:c}', sum) #>")
the total disappears.
all want total updates after user changes something. idea i'm doing wrong?
thanks
columns.bound(p => p.itemprice) .footertemplate( @<text> total:@string.format("{0:c}", model.itemprice) </text> ) .width(100) .format("{0:c}");
Comments
Post a Comment