Vue Kendo Native Grid Grouping Aggregates CANNOT show the format

1 Answer 121 Views
Grid
Dev
Top achievements
Rank 1
Iron
Iron
Dev asked on 03 Jun 2021, 09:52 AM

Hi, here is my problem.

I used the Vue Kendo Native Grid Grouping.

When it is Basics, it CAN show the format of columns. (As the screenshot of CAN format)

The STACKBLITZ example in this page is the one I tried for CAN format. 

https://www.telerik.com/kendo-vue-ui/components/grid/grouping/

 

---

But when it is Aggregates, it CANNOT show the format of columns. (As the screenshot of CANNOT format)

The STACKBLITZ example in this page is the one I tried for CANNOT format. 

https://www.telerik.com/kendo-vue-ui/components/grid/grouping/grouping/

 

How can I show the format of columns when I use the Vue Kendo Grid Grouping Aggregates?

Thank you a lot!!!

1 Answer, 1 is accepted

Sort by
1
Petar
Telerik team
answered on 08 Jun 2021, 08:39 AM

Hi Dev,

Thank you for the provided details about the experienced issue. The reason why the format is not applied in the second example is that it uses a template. This template overrides the format set with the "format" property. 

To add formatting to the "UnitPrice" field, you can use the following code in the CellComponent.vue component.

    if(fieldName ==="UnitPrice" && data!==undefined){
      return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(data)
    }

The above is added to the nestedValue function and the UnitPrice is displayed as in the first example you sent us. 

Here is a StackBlitz example demonstrating the usage of the above snippet.

Check the above link and let me know if you have any questions about the provided implementation. 

If you need further assistance with the current ticket, I will be happy to help you.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Dev
Top achievements
Rank 1
Iron
Iron
commented on 12 Jun 2021, 01:52 PM

I got it! Thank you so much!!!
Petar
Telerik team
commented on 14 Jun 2021, 06:15 AM

You are welcome!
Tags
Grid
Asked by
Dev
Top achievements
Rank 1
Iron
Iron
Answers by
Petar
Telerik team
Share this question
or