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

[Solved] frozen columns in grid

4 Answers 364 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 11 Dec 2014, 07:18 PM
I have the latest version of kendo ui Kendo UI v2014.3.1119.  When I set the first column to be frozen, the 2nd column went to the next row, not in the same row as first column.  The width of the grid is restricted by bootstrap <div class="col-md-10"> and it has horizontal scrollbar before the frozen column.  What did I miss? How can I fix it?
Thanks.

$("#gdActualReport").kendoGrid({
dataSource: reportDataSource,
sortable: false,
pageable: false,
selectable: "row",
scrobllable: true,
height: 700,
toolbar: ["excel"],
excel: {
fileName: "Report.xlsx",
allPages: true
},
columns: [
{ field: "itemName", title: "Item Name", locked: true, lockable: false, attributes: { style: "text-align:left" }, width: "200px" },
{ field: "actual[0]", title: "January", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[1]", title: "February", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[2]", title: "March", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[3]", title: "April", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[4]", title: "May", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[5]", title: "June", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[6]", title: "July", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[7]", title: "August", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[8]", title: "September", attributes: { style: "text-align:right" }, width: "90px" },
{ field: "actual[9]", title: "October", attributes: { style: "text-align:right" }, width: "80px" },
{ field: "actual[10]", title: "November", attributes: { style: "text-align:right" }, width: "90px" },
{ field: "actual[11]", title: "December", attributes: { style: "text-align:right" }, width: "90px" },
{ field: "actual[12]", title: "Total", attributes: { style: "text-align:right" }, width: "80px" }
]
});

4 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 13 Dec 2014, 03:00 PM
Hello Bertha,

I tried reproducing the issue using the code you shared, but to no avail. Would you please check this example and let me know if I am missing something?

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bertha
Top achievements
Rank 1
answered on 15 Dec 2014, 03:39 PM
Thanks for the useful example.  It helps to narrow down one of my library file is out-dated.

Now, I have another issue.  I use rowTemplate and altRowTemplate.  How can I maintain the first column to be frozen?  Thanks.

rowTemplate: '<tr class="#:itemName.indexOf(\"Total\") > -1 ? \"skyblue\" : \"whiteRow\"#" data-uid="#= uid #"><td>#:itemName #</td><td style=\"text-align:right\">#: (actual[0] == null) ? \"\" : kendo.toString(actual[0], \"c0\") #</td><td style=\"text-align:right\">#: (actual[1] == null) ? \"\" : kendo.toString(actual[1], \"c0\") #</td><td style=\"text-align:right\">#: (actual[2] == null) ? \"\" : kendo.toString(actual[2], \"c0\") #</td><td style=\"text-align:right\">#: (actual[3] == null) ? \"\" : kendo.toString(actual[3], \"c0\") #</td><td style=\"text-align:right\">#: (actual[4] == null) ? \"\" : kendo.toString(actual[4], \"c0\") #</td><td style=\"text-align:right\">#: (actual[5] == null) ? \"\" : kendo.toString(actual[5], \"c0\") #</td><td style=\"text-align:right\">#: (actual[6] == null) ? \"\" : kendo.toString(actual[6], \"c0\") #</td><td style=\"text-align:right\">#: (actual[7] == null) ? \"\" : kendo.toString(actual[7], \"c0\") #</td><td style=\"text-align:right\">#: (actual[8] == null) ? \"\" : kendo.toString(actual[8], \"c0\") #</td><td style=\"text-align:right\">#: (actual[9] == null) ? \"\" : kendo.toString(actual[9], \"c0\") #</td><td style=\"text-align:right\">#: (actual[10] == null) ? \"\" : kendo.toString(actual[10], \"c0\") #</td><td style=\"text-align:right\">#: (actual[11] == null) ? \"\" : kendo.toString(actual[11], \"c0\") #</td><td style=\"text-align:right\">#: (actual[12] == null) ? \"\" : kendo.toString(actual[12], \"c0\") #</td></tr>',       
0
Bertha
Top achievements
Rank 1
answered on 15 Dec 2014, 03:44 PM
Thanks for the useful example.  It helps me to find one of my library file is out-dated.

But another issue comes up.  I use rowTemplate and altRowTemplate.  How to make the first column frozen?  Thanks.

rowTemplate: '<tr class="#:itemName.indexOf(\"Total\") > -1 ? \"skyblue\" : \"whiteRow\"#"
0
Accepted
Alexander Popov
Telerik team
answered on 15 Dec 2014, 04:00 PM
Hi Bertha,

I am afraid that having both row templates and locked columns is not supported and there is no workaround that we can recommend.

Regards,
Alexander Popov
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
Bertha
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Bertha
Top achievements
Rank 1
Share this question
or