This is a migrated thread and some comments may be shown as answers.

multiple custom group footer template names

3 Answers 589 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bajivali
Top achievements
Rank 1
Bajivali asked on 29 Aug 2016, 01:56 PM
multiple custom group footer template names
   
   
   

I have my grid.

<div class="grid-scrollable">
   <div>
    @(Html.Kendo().Grid<ViewModels.Payment.BhFormExpenseRRViewModel>()
    .Name("BHFormPATHRRGrid")
    .Events(e => e.DataBound("dataBoundpath"))
    .Events(e => e.Save("onBhFormpathModelGridSave"))
    .Events(e => e.Edit("onBhFormpathModelGridEdit"))
    .Columns(columns =>
    {
     columns.Bound(p => p.Id).Hidden(true);
     columns.Bound(p => p.ECId).Hidden(true);
     columns.Bound(p => p.ExpenseCategory).ClientFooterTemplate("Total Payment Requested")
     .ClientGroupFooterTemplate("Total Expenses").EditorTemplateName("Decimal").Format("{0:c}");
     columns.Group(g => g.Title("Current Month Expenses")
      .Columns(a =>
     {
      a.Bound(c => c.ThisMonthPath).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
      a.Bound(c => c.ThisMonthMatch).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
      
     }));
     columns.Group(g => g.Title("Reduced Monthly Expenses")
      .Columns(a =>
     {
      a.Bound(c => c.ReduceExpensesBy).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
      .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
      a.Bound(c => c.CurrentMonthExpensesSubmitted).EditorTemplateName("Decimal").Title("AdjustedPathAmount").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
      .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
     }));
     columns.Group(g => g.Title("Prior Month Expenses")
      .Columns(a =>
     {
      a.Bound(c => c.PriorMonthMatch).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
      a.Bound(c => c.PriorMonthPath).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
     }));
     columns.Group(g => g.Title("Cumulative Expenses YTD")
      .Columns(a =>
     {
      a.Bound(c => c.YtdMonthMatch).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
      a.Bound(c => c.YtdMonthPath).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
     .ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
     }));
     columns.Command(command =>
     {
      command.Edit().HtmlAttributes(new { @class = "btn-primary k-grid-edit" });
     }).Width(200);
    })
    .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
    .Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(5))
    .Sortable()
    .Filterable(f => f.Operators(o => o.ForString(s => s.Clear()
     .Contains("Contains")
     .DoesNotContain("Does not contain")
     .IsEqualTo("Is equal to")
     .IsNotEqualTo("Is not equal to")
     .StartsWith("Starts with")
     .EndsWith("Ends with "))))
    .Selectable()
    .Resizable(resize => resize.Columns(true))
    .DataSource(dataSource => dataSource.Ajax().PageSize(20).Model(model => model.Id(p => p.ECId)).Model(model => model.Field(p => p.TotalProirExpensesBilled).Editable(false)).Model(model => model.Field(p => p.CurrentMonthExpensesSubmitted).Editable(false)).Model(model => model.Field(p => p.TotalExpensesYtd).Editable(false)).Model(model => model.Field(p => p.ExpenseCategory).Editable(false))
    .Model(model => model.Field(p => p.PriorMonthMatch).Editable(false)).Model(model => model.Field(p => p.PriorMonthPath).Editable(false)).Model(model => model.Field(p => p.YtdMonthMatch).Editable(false)).Model(model => model.Field(p => p.YtdMonthPath).Editable(false))
    .Aggregates(aggregates =>
    {
     aggregates.Add(p => p.ThisMonthMatch).Sum();
     aggregates.Add(p => p.ThisMonthPath).Sum();
     aggregates.Add(p => p.PriorMonthMatch).Sum();
     aggregates.Add(p => p.PriorMonthPath).Sum();
     aggregates.Add(p => p.YtdMonthMatch).Sum();
     aggregates.Add(p => p.YtdMonthPath).Sum();
     aggregates.Add(p => p.ReduceExpensesBy).Sum();
     aggregates.Add(p => p.CurrentMonthExpensesSubmitted).Sum();
    })
    .Update(update => update.Action("EditBHFormRR", "ReimbursementRequestProvider").Data("additionalInfoPath"))
    .Events(events => events.Error("errorpath"))
    .Group(groups => groups.Add(p => p.ExpenseTypeId))
    .Read(read => read.Action("BHFromExpenseGridRead", "ReimbursementRequestProvider", new { bhFormName = Model.BHFormsName, reimbursementEbsId = Model.ReimbursementEbsId, prrId = Model.PrrId, rrState = @ViewBag.RRStateRequest, serviceMonth = Model.ServiceMonth }))
    )
    )
   </div>
  </div>

 

my requirement is
change group client footer of group 1 to "Total Payment Requested" instead of "Total Expenses"
change group client footer of group 2 to "Total Match Claimed" instead of "Total Expenses"
TOTAL OF TOTAL AS "Total Billing Submitted" instead of "Total Payment Requested"

 

the issue is I have name the group client footer on custom basis.

example group 1 sum footer name should be something different than group 2 sum footer name.

 

can any one help me on this please?











3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Sep 2016, 07:16 AM
Hello Bajivali,

I've already replied to your other thread with ID: 1059359. I suggest that we continue our conversation on the mentioned thread.

Also, please note that the CodeLibrary section is suitable for working projects provided by our community. For technical questions, please open a Forum post or formal Support thread.

Regards,
Eyup
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Narendra
Top achievements
Rank 1
answered on 14 Oct 2017, 02:20 AM

hi Eyup, 

I have the same requirement. Can you please provide the solution here. 

Thanks,

Narendra

0
Stefan
Telerik team
answered on 18 Oct 2017, 12:05 PM
Hello, Narendra,

The provided answer by Eyup suggested checking the following resources as the built-in groupFooterTemplate keeps the calculated aggregates instead of the individual values:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.groupFooterTemplate

http://www.telerik.com/forums/grid-group-footer-names

http://stackoverflow.com/questions/28403288/how-to-get-group-by-column-value-in-group-footer-template-in-kendo-grid

If additional assistance is needed, please let us know and we will gladly assist.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Bajivali
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Narendra
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or