Hi Guys,
I'm hitting a slight problem with the formatting of dates in a group header.
The situation is as follows:-
- I have a template on a cell to format an ISO 8601 date string into the user's preference using an AngularJS filter
{field: "LOG_CREATED_ISO", title: "Date/Time", width:"150px", template: "{{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}"},
Where localeShortDate in this instance is $scope.localeShortDate = 'dd MMM yyyy';
- This works well within the confines of the cell which shows
24 Dec 2014 08:10:42
- But when you group on this column, the header shows
Date/Time: Wed Dec 24 2014 08:10:42 GMT+0000 (GMT Standard Time)
(See attached image)
- I have searched the docs & forums for help on how to format the Group Header to be same as the cell, but have so far drawn a blank.
Therefore any guidance on this matter would be much appreciated.
Regards
Alan
I'm hitting a slight problem with the formatting of dates in a group header.
The situation is as follows:-
- I have a template on a cell to format an ISO 8601 date string into the user's preference using an AngularJS filter
{field: "LOG_CREATED_ISO", title: "Date/Time", width:"150px", template: "{{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}"},
Where localeShortDate in this instance is $scope.localeShortDate = 'dd MMM yyyy';
- This works well within the confines of the cell which shows
24 Dec 2014 08:10:42
- But when you group on this column, the header shows
Date/Time: Wed Dec 24 2014 08:10:42 GMT+0000 (GMT Standard Time)
(See attached image)
- I have searched the docs & forums for help on how to format the Group Header to be same as the cell, but have so far drawn a blank.
Therefore any guidance on this matter would be much appreciated.
Regards
Alan
6 Answers, 1 is accepted
0
Hello Alan,
You can set the groupHeaderTemplate to customize the group header. There is no property that enables sharing of the template between data cells and the group header.
Regards,
Alex Gyoshev
Telerik
You can set the groupHeaderTemplate to customize the group header. There is no property that enables sharing of the template between data cells and the group header.
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AGB
Top achievements
Rank 1
Iron
answered on 25 Dec 2014, 10:50 AM
Hi Alex,
Thanks for the pointer but it would appear this does not help with formatting the ISO date string.
I have tried adding the following to header template
groupHeaderTemplate: "#= value #"
Header shows: Thu Dec 25 2014 10:09:20 GMT+0000 (GMT Standard Time)
groupHeaderTemplate: "{{#= value # | date:localeShortDate + ' HH:mm:ss'}}"
Header shows: {{Thu Dec 25 2014 10:09:20 GMT+0000 (GMT Standard Time) | date:localeShortDate + ' HH:mm:ss'}}
groupHeaderTemplate: "{{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}"
Header shows: {{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}
but every combination I have tried does not result in a formatted date.
So unless you have any other ideas I can only assume you do not support formatting of dates within a group header.
Regards
Alan
Thanks for the pointer but it would appear this does not help with formatting the ISO date string.
I have tried adding the following to header template
groupHeaderTemplate: "#= value #"
Header shows: Thu Dec 25 2014 10:09:20 GMT+0000 (GMT Standard Time)
groupHeaderTemplate: "{{#= value # | date:localeShortDate + ' HH:mm:ss'}}"
Header shows: {{Thu Dec 25 2014 10:09:20 GMT+0000 (GMT Standard Time) | date:localeShortDate + ' HH:mm:ss'}}
groupHeaderTemplate: "{{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}"
Header shows: {{dataItem.LOG_CREATED_ISO | date:localeShortDate + ' HH:mm:ss'}}
but every combination I have tried does not result in a formatted date.
So unless you have any other ideas I can only assume you do not support formatting of dates within a group header.
Regards
Alan
0
Hello Alan,
It appears that the AngularJS groupHeaderTemplate is not compiled, as noted in this thread -- I am sorry for misguiding you.
In case you are using the template just for the date formatting, you can use the columns.format configuration option instead, like shown in this Dojo snippet.
Regards,
Alex Gyoshev
Telerik
It appears that the AngularJS groupHeaderTemplate is not compiled, as noted in this thread -- I am sorry for misguiding you.
In case you are using the template just for the date formatting, you can use the columns.format configuration option instead, like shown in this Dojo snippet.
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AGB
Top achievements
Rank 1
Iron
answered on 26 Dec 2014, 11:58 AM
Hi Alex
Thanks for the update, but unfortunately I cannot use the columns.format method because I need to use a number of AngularJS Date/Number/String filters to format column data against user preferences.
Reading through the other thread I can see you have acknowledge this as a Kendo Grid fault but seeing as the thread was started on Sep 23 and the last post was on Dec 9 I was wondering if you have further updates when a fix might be available.
Regards
Alan
Thanks for the update, but unfortunately I cannot use the columns.format method because I need to use a number of AngularJS Date/Number/String filters to format column data against user preferences.
Reading through the other thread I can see you have acknowledge this as a Kendo Grid fault but seeing as the thread was started on Sep 23 and the last post was on Dec 9 I was wondering if you have further updates when a fix might be available.
Regards
Alan
0
Hello Alan,
I'm afraid that this is still not implemented. I have notified the developers of the grid widget to raise the priority of this work item.
Regards,
Alex Gyoshev
Telerik
I'm afraid that this is still not implemented. I have notified the developers of the grid widget to raise the priority of this work item.
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AGB
Top achievements
Rank 1
Iron
answered on 27 Dec 2014, 10:50 AM
Thanks Alex
Much appreciated
Regards
Alan
Much appreciated
Regards
Alan