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

ColumnMenu doesn't display correct title when used with AngularJS template

4 Answers 229 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Radio Vaticana
Top achievements
Rank 1
Radio Vaticana asked on 08 Aug 2014, 10:03 AM
Hi,
I have to translate column titles of a kendo grid created with AngularJS directives.

I used ngTranslate to manage translations and set the column title like
title : "{{ 'FIRSTNAME' | translate }}"

All works fine, including live language switch. Columns titles reflect language changes and display the correct translation.
Unfortunately the column menu display wrong titles.

When I expand column menu I see the following text
{{ 'FIRSTNAME' | translate }}
instead translation.

I have attached
- a zip including an html file (create with your dojo) to replicate the issue
- an image that show as column menu appears when AngularJS filter are used in column title

I need that column menu display translation in the same way the grid do.

Can you help me?

Thanks

4 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 12 Aug 2014, 12:19 PM
Hello,

This looks like a scenario that is not supported currently with the Kendo UI Grid. I have logged this in our internal issues tracker, so I hope this functionality will be implemented soon. As soon as more information is available I will make sure to get back to you.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gregor
Top achievements
Rank 1
answered on 30 Oct 2014, 06:41 AM
Hi there.
Is now a solution for this problem available ?
Angular translate ist still not working.
I´v tried to capture the translation event from angular and go this way 
$rootScope.$on('$translateChangeSuccess', function () {
for (var i = $scope.mainGridOptions.columns.length - 1; i >= 0; i--) {
    $scope.mainGridOptions.columns[i].title = $translate.instant('value to translate');
};

But this is also not working :(

How can we translate the column title ??



Please helt





0
Gregor
Top achievements
Rank 1
answered on 30 Oct 2014, 07:18 AM
I found a working jquery way for me, but nice is something different

 $rootScope.$on('$translateChangeSuccess', function () {
   var mygrid = $("#grid thead");
for (var i = $scope.mainGridOptions.columns.length - 1; i >= 0; i--) {
   var translatedHeader = $translate.instant("Orders_" + $scope.mainGridOptions.columns[i].field);
   mygrid.find("[data-field='" + $scope.mainGridOptions.columns[i].field + "'] a.k-link").html(translatedHeader);
};

  });
0
Kiril Nikolov
Telerik team
answered on 31 Oct 2014, 08:44 AM
Hi Gregor,

The issue should be resolved in the latest build of Kendo UI. So please try with upgrading to the latest version and test it out. if the problem still persists please extract a runnable sample and send it to us, so we can reproduce the issue. Here is the runnable example:

http://dojo.telerik.com/EYaF

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Radio Vaticana
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Gregor
Top achievements
Rank 1
Share this question
or