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

Column headerAttributes not working properly

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
phx255
Top achievements
Rank 1
phx255 asked on 10 Oct 2016, 03:01 PM

Hi!, I'm having a problem using headerAttributes on a kendo ui Grid column.

var columnas = [];

columnas.push({ 

              headerAttributes: {                 

      style: "font-size: 14px"               },               title: "Desc",               field: "nombre",               width: 170,                 groupFooterTemplate:

 groupFooterTemplatePadre,

              footerTemplate: FooterTemplate});

 

grid = $("#grid").kendoGrid({     dataSource: dataSource,     groupable: false,     pdf: {         allPages: true,         avoidLinks: true,         paperSize: "auto",         margin: { top: "1cm", left: "1cm", right: "1cm", bottom: "1cm" },         landscape: true,         repeatHeaders: false,         scale: 0.4     },     resizable: false,     editable: !viewModelTitulo.cerrada,     selectable: "row",     navigatable: true,     scrollable: true,     columns: columnas,     dataBound: function(e){         var rows = e.sender.tbody.children();         for (var j = 0; j < rows.length; j++) {             var row = $(rows[j]);             var dataItem = e.sender.dataItem(row);             if (dataItem!=null && dataItem.get("nombre").toLowerCase().indexOf("company") >= 0) {                 row.addClass("green");             }         }     }});

 

using this code on a Kendo ui Grid the column header shows the image attached.

it's a bug?

Thanks!

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
phx255
Top achievements
Rank 1
answered on 10 Oct 2016, 03:05 PM
01.  var columnas = [];
02. 
03.columnas.push({
04.               headerAttributes: {
05.                   style: "font-size: 14px"
06.               },
07.               title: "Desc",
08.               field: "nombre",
09.               width: 170, 
10.               groupFooterTemplate: groupFooterTemplatePadre,
11.               footerTemplate: FooterTemplate});
12. 
13. 
14. 
15.           grid = $("#grid").kendoGrid({
16.               dataSource: dataSource,
17.               groupable: false,
18.               pdf: {
19.                   allPages: true,
20.                   avoidLinks: true,
21.                   paperSize: "auto",
22.                   margin: { top: "1cm", left: "1cm", right: "1cm", bottom: "1cm" },
23.                   landscape: true,
24.                   repeatHeaders: false,
25.                   scale: 0.4
26.               },
27. 
28.               resizable: false,
29.               editable: true,
30.               selectable: "row",
31.               navigatable: true,
32.               scrollable: true,
33.               columns: columnas,
34.               dataBound: function(e){
35.                   var rows = e.sender.tbody.children();
36. 
37.                   for (var j = 0; j < rows.length; j++) {
38.                       var row = $(rows[j]);
39.                       var dataItem = e.sender.dataItem(row);
40.                       if (dataItem!=null && dataItem.get("nombre").toLowerCase().indexOf("copasa") >= 0) {
41.                           row.addClass("conceptoCopasa");
42.                       }
43.                   }
44.               }
45. 
46.           });
0
Accepted
Rosen
Telerik team
answered on 11 Oct 2016, 11:28 AM

Hello phx255,

Unfortunately, I'm not able to observe such issue locally using the provided information. Please take a look at this test page. Maybe I'm missing something obvious.

Regards,
Rosen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
phx255
Top achievements
Rank 1
Answers by
phx255
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or