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

cant get the ClientFooterTemplate to show

3 Answers 429 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 26 Apr 2016, 09:24 PM

hi,

i can get the group footer to show, but the total client footer. below is the code.  any ideas?  thanks.

 

    @(Html.Kendo().Grid<ClientReporting.ViewModels.Reports.VolumeViewModel>
        ()
        .Name("ReportGrid")
        .Columns(columns =>
        {
            columns.Bound(o => o.Firm).Width(130).Locked(true);
            columns.Bound(o => o.Collat).Width(70);
            columns.Bound(o => o.UserName).Width(100).Title("User");
            columns.Bound(o => o.Product).Title("Product Type").Width(110);
            columns.Bound(o => o.Symbol).Title("Symbol").Width(100);
            columns.Bound(o => o.Volume).Title("Amount (USD)").Width(150).Format("{0:n0}")
                    .ClientGroupFooterTemplate("Sub-total: #= kendo.toString(sum, \"n2\")#")
                    .ClientFooterTemplate("Period Total: #= kendo.toString(sum, \"n2\")#");
        })
        .ToolBar(tools => tools.Excel())
        .Excel(excel => excel
        .FileName("RevenueReport.xlsx")
        .Filterable(true)
        .AllPages(true)
        .ProxyURL(Url.Action("ExcelExportSave", "ReportGrid"))
        )
        .Sortable()
        .AllowCopy(true)
        .ColumnMenu()
        .Groupable(group => group.ShowFooter(true))
        .Resizable(resize => resize.Columns(true))
        .Scrollable(scrollable => scrollable.Virtual(true))
        .Scrollable(s => s.Height("500px"))
        .Filterable(filterable => filterable
        .Extra(true)
        .Operators(operators => operators
        .ForNumber(n => n.Clear()
        .IsEqualTo("Is Equal To")
        .IsGreaterThan("Is Greater Than")
        .IsGreaterThanOrEqualTo("Is Greater Than Or Equalt To")
        .IsLessThan("Is Less Than")
        .IsLessThanOrEqualTo("Is Less Than Or Equal To")
        )
        .ForDate(d => d.Clear()
        .IsEqualTo("Is Equal To")
        .IsGreaterThan("Is Greater Than")
        .IsGreaterThanOrEqualTo("Is Greater Than Or Equal To")
        .IsLessThan("Is Less Than")
        .IsLessThanOrEqualTo("Is Less Than Or Equal To"))
        )
        )
        .Selectable(selectable => selectable
            .Mode(GridSelectionMode.Multiple)
            .Type(GridSelectionType.Row)
        )
        .AutoBind(false)
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(100)
            .Model(model =>
            {
                model.Id(p => p.Firm);
                model.Field(p => p.Collat).Editable(false);
                model.Field(p => p.UserName).Editable(false);
                model.Field(p => p.Product).Editable(false);
                model.Field(p => p.Symbol).Editable(false);
                model.Field(p => p.Volume).Editable(false);
            })
        .Read(read => read.Action("Volume", "ReportGrid")
        .Data("GetGridData"))
        .Group(groups =>
        {
            groups.Add(model => model.Firm);
            groups.Add(model => model.Collat);
            groups.Add(model => model.UserName);
            groups.Add(model => model.Product);
            groups.Add(model => model.Symbol);
        })
        .Aggregates(aggregates =>
        {
            aggregates.Add(model => model.Volume).Sum();
        })

        .Events(events => events.Error("onError").Change("onChange"))
        ))


3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Apr 2016, 03:18 PM
Hi James,

The provided code works as expected on my side, when I use some other data, but with your settings. I see that the Grid has AutoBind set to false. How do you trigger the data to load? Is the Grid recreated at any point? Can you provide an example or a live URL for inspection?

Regards,
Dimo
Telerik
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
James
Top achievements
Rank 1
answered on 28 Apr 2016, 04:10 PM

i guess lets define "as expected" first.  what i expect is to see the group sum footer - "Sub-total" after every group and then at the end of the page, with all of the groups collapsed (default) or in any other state of being open, as the last line the "Period Total" sum.  i do not see the last line, i.e. the grand total.

the data is bound when the user hits submit after selecting a few parameters   no, the the grid is not recreated.  i can post a screenshot of what the grid looks like if needed.

unfortunately i cant expose the url, its an internal report.

thanks.

0
Accepted
Dimo
Telerik team
answered on 29 Apr 2016, 09:04 AM
Hi James,

>> "what i expect is to see the group sum footer - "Sub-total" after every group and then at the end of the page, with all of the groups collapsed (default) or in any other state of being open, as the last line the "Period Total" sum."

Yes, this is what I see on my side. Here is a screenshot and a code snippet. I have tested this in our offline ASP.NET MVC demos. Can you provide an isolated runnable example, which exhibits the unexpected behavior?

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>
      ()
      .Name("ReportGrid")
      .Columns(columns =>
      {
          columns.Bound(o => o.ProductID).Width(430).Locked(true);
          columns.Bound(o => o.UnitsInStock).Title("Amount (USD)").Width(650).Format("{0:n0}")
                  .ClientGroupFooterTemplate("Sub-total: #= kendo.toString(sum, \"n2\")#")
                  .ClientFooterTemplate("Period Total: #= kendo.toString(sum, \"n2\")#");
      })
      .ToolBar(tools => tools.Excel())
      .Excel(excel => excel
      .FileName("RevenueReport.xlsx")
      .Filterable(true)
      .AllPages(true)
      .ProxyURL(Url.Action("ExcelExportSave", "ReportGrid"))
      )
      .Sortable()
      .AllowCopy(true)
      .ColumnMenu()
      .Groupable(group => group.ShowFooter(true))
      .Resizable(resize => resize.Columns(true))
      .Scrollable(scrollable => scrollable.Virtual(true))
      .Scrollable(s => s.Height("500px"))
      .Filterable(filterable => filterable
      .Extra(true)
      .Operators(operators => operators
      .ForNumber(n => n.Clear()
      .IsEqualTo("Is Equal To")
      .IsGreaterThan("Is Greater Than")
      .IsGreaterThanOrEqualTo("Is Greater Than Or Equalt To")
      .IsLessThan("Is Less Than")
      .IsLessThanOrEqualTo("Is Less Than Or Equal To")
      )
      .ForDate(d => d.Clear()
      .IsEqualTo("Is Equal To")
      .IsGreaterThan("Is Greater Than")
      .IsGreaterThanOrEqualTo("Is Greater Than Or Equal To")
      .IsLessThan("Is Less Than")
      .IsLessThanOrEqualTo("Is Less Than Or Equal To"))
      )
      )
      .Selectable(selectable => selectable
          .Mode(GridSelectionMode.Multiple)
          .Type(GridSelectionType.Row)
      )
      .DataSource(dataSource => dataSource
          .Ajax()
          .PageSize(100)
          .Model(model =>
          {
              model.Id(p => p.ProductID);
              model.Field(p => p.UnitsInStock).Editable(false);
          })
      .Read(read => read.Action("Aggregates_Read", "Grid"))
      .Group(groups =>
      {
          groups.Add(model => model.CategoryID);
      })
      .Aggregates(aggregates =>
      {
          aggregates.Add(model => model.UnitsInStock).Sum();
      })
 
      ))


Regards,
Dimo
Telerik
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
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Dimo
Telerik team
James
Top achievements
Rank 1
Share this question
or