This question is locked. New answers and comments are not allowed.
Hi,
We have a Telerik MVC grid
It has Ajax binding
It has couple of columns with footer that display sum
One of the columns is editable
On updating the column value, footer is not getting updated
Below is the grid definition
Could you please advice what we need to do
@{
Html.Telerik().Grid(Model.ClaimLines)
.Name("ClaimLines")
.DataBinding(dataBinding =>
dataBinding
.Ajax()
.Update("UpdateClaim", "ProcessClaim")
.Select("_ShowDetails", "ProcessClaim", new { clientId = Model.ClientId, claimId = Model.ClaimNumber, importTransactionId = Model.ImportTransactionId })
)
.DataKeys(kf =>
{
kf.Add(cl => cl.AssignedNumber).RouteKey("assignedNumber");
})
.Columns(columns =>
{
columns.Bound(cl => cl.DOSFrom).Width(90).ReadOnly();
columns.Bound(cl => cl.DOSTo).Width(85).ReadOnly();
columns.Bound(cl => cl.POS).Width(60).ReadOnly();
columns.Bound(cl => cl.CPT).Width(60).ReadOnly();
columns.Bound(cl => cl.Modifier).Width(110).Title("Modifiers").ReadOnly();
columns.Bound(cl => cl.Description).Width(200).ReadOnly()
.HtmlAttributes(new { style = "height: auto; word-wrap: break-word;" })
.FooterTemplate(@<text>Total :</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Charge).Width(60).ReadOnly().HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Units).Width(50).ReadOnly().HtmlAttributes(new { style = "text-align:right" }).FooterHtmlAttributes(new { style = "border-right: 1px solid gray;" });
columns.Bound(cl => cl.Allowed).Width(60).ReadOnly().HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.RepricedAmount).Width(130).HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Source)
.HtmlAttributes(new { style = "height: auto; word-wrap: break-word;" });
if(Model.ClaimStatus != "Submitted" && Model.ClaimStatus != "Released" && Model.ClaimStatus != "Pended"){
columns.Command(cf => cf.Edit().HtmlAttributes(new { style = "min-width:40px !important;" })).Width(80);
}
})
.Scrollable(builder => builder.Enabled(true).Height("100%"))
.ClientEvents(events => events.OnCommand("onCommand"))
.Resizable(configurator => configurator.Columns(true))
.Render();
}
PS: We also tried to add a OnSave Client event
function onSave(e) {
//debugger;
setTimeout(function () {
var grid = $('#ClaimLines').data('tGrid');
grid.ajaxRequest();
}, 100);
}
That did not work either
Thanks,
Siva
We have a Telerik MVC grid
It has Ajax binding
It has couple of columns with footer that display sum
One of the columns is editable
On updating the column value, footer is not getting updated
Below is the grid definition
Could you please advice what we need to do
@{
Html.Telerik().Grid(Model.ClaimLines)
.Name("ClaimLines")
.DataBinding(dataBinding =>
dataBinding
.Ajax()
.Update("UpdateClaim", "ProcessClaim")
.Select("_ShowDetails", "ProcessClaim", new { clientId = Model.ClientId, claimId = Model.ClaimNumber, importTransactionId = Model.ImportTransactionId })
)
.DataKeys(kf =>
{
kf.Add(cl => cl.AssignedNumber).RouteKey("assignedNumber");
})
.Columns(columns =>
{
columns.Bound(cl => cl.DOSFrom).Width(90).ReadOnly();
columns.Bound(cl => cl.DOSTo).Width(85).ReadOnly();
columns.Bound(cl => cl.POS).Width(60).ReadOnly();
columns.Bound(cl => cl.CPT).Width(60).ReadOnly();
columns.Bound(cl => cl.Modifier).Width(110).Title("Modifiers").ReadOnly();
columns.Bound(cl => cl.Description).Width(200).ReadOnly()
.HtmlAttributes(new { style = "height: auto; word-wrap: break-word;" })
.FooterTemplate(@<text>Total :</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Charge).Width(60).ReadOnly().HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Units).Width(50).ReadOnly().HtmlAttributes(new { style = "text-align:right" }).FooterHtmlAttributes(new { style = "border-right: 1px solid gray;" });
columns.Bound(cl => cl.Allowed).Width(60).ReadOnly().HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.RepricedAmount).Width(130).HtmlAttributes(new { style = "text-align:right" })
.Aggregate(aggreages => aggreages.Sum())
.Format("{0:c}")
.FooterTemplate(@<text>@item.Sum.Format("{0:c}")</text>)
.FooterHtmlAttributes(new { style = "text-align:right; font-weight:bold;border-right: 1px solid gray;" });
columns.Bound(cl => cl.Source)
.HtmlAttributes(new { style = "height: auto; word-wrap: break-word;" });
if(Model.ClaimStatus != "Submitted" && Model.ClaimStatus != "Released" && Model.ClaimStatus != "Pended"){
columns.Command(cf => cf.Edit().HtmlAttributes(new { style = "min-width:40px !important;" })).Width(80);
}
})
.Scrollable(builder => builder.Enabled(true).Height("100%"))
.ClientEvents(events => events.OnCommand("onCommand"))
.Resizable(configurator => configurator.Columns(true))
.Render();
}
PS: We also tried to add a OnSave Client event
function onSave(e) {
//debugger;
setTimeout(function () {
var grid = $('#ClaimLines').data('tGrid');
grid.ajaxRequest();
}, 100);
}
That did not work either
Thanks,
Siva