Hi,
We have a case where we have applied the css style of 'position: fixed' on thead element of the grid. We have given the grid header columns as certain widths. Now when we try to resize the column, resize handle doesn't appear - we change its top position and then it appears. But still the column resize event doesn't fire.
We can't use the grid's locked property as we don't want scroll bar on the grid, but it should be on the page.
Could you please let me know where is the issue.
Thanks a lot.
We have a case where we have applied the css style of 'position: fixed' on thead element of the grid. We have given the grid header columns as certain widths. Now when we try to resize the column, resize handle doesn't appear - we change its top position and then it appears. But still the column resize event doesn't fire.
We can't use the grid's locked property as we don't want scroll bar on the grid, but it should be on the page.
Could you please let me know where is the issue.
Thanks a lot.
6 Answers, 1 is accepted
0
Hello Abhishek,
The described scenario is considered too hackish and is not supported due to the numerous complications and side effects.
You can use a fixed Grid header when scrolling is enabled. and the Grid header area is in a separate <table>. I have provided an example below. However, it really doesn't make much sense, given that you can use an auto-expanding 100% high Grid with a lot less hassle, as in the following jsFiddle example:
http://jsfiddle.net/dimodi/war0v0u3/
Regards,
Dimo
Telerik
The described scenario is considered too hackish and is not supported due to the numerous complications and side effects.
You can use a fixed Grid header when scrolling is enabled. and the Grid header area is in a separate <table>. I have provided an example below. However, it really doesn't make much sense, given that you can use an auto-expanding 100% high Grid with a lot less hassle, as in the following jsFiddle example:
http://jsfiddle.net/dimodi/war0v0u3/
<!DOCTYPE html>
<
html
>
<
head
>
<
base
href
=
"http://demos.telerik.com/kendo-ui/grid/column-resizing"
>
<
style
>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</
style
>
<
title
></
title
>
<
link
href
=
"http://cdn.kendostatic.com/2014.2.903/styles/kendo.common.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"http://cdn.kendostatic.com/2014.2.903/styles/kendo.default.min.css"
rel
=
"stylesheet"
/>
<
script
src
=
"http://cdn.kendostatic.com/2014.2.903/js/jquery.min.js"
></
script
>
<
script
src
=
"http://cdn.kendostatic.com/2014.2.903/js/kendo.web.min.js"
></
script
>
<
style
>
html,
body
{
margin: 0;
padding: 0;
}
#grid,
#grid .k-grid-header
{
width: 100%;
border-width: 0;
padding: 0 !important;
}
#grid .k-grid-header
{
position: fixed;
top: 0;
z-index: 2;
}
#grid > .k-grid-content
{
overflow: visible !important;
}
</
style
>
</
head
>
<
body
>
<
div
id
=
"example"
>
<
div
id
=
"grid"
></
div
>
<
script
>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
},
schema: {
model: {
fields: {
OrderID: { type: "number" },
ShipCountry: { type: "string" },
ShipCity: { type: "string" },
ShipName: { type: "string" },
OrderDate: { type: "date" },
ShippedDate: { type: "date" }
}
}
},
pageSize: 100
},
sortable: true,
resizable: true,
pageable: true,
columns: [
{
field: "OrderDate",
title: "Order Date",
width: 120,
format: "{0:MM/dd/yyyy}"
},
{
field: "ShipCountry",
title: "Ship Country"
},
{
field: "ShipCity",
title: "Ship City"
},
{
field: "ShipName",
title: "Ship Name"
},
{
field: "ShippedDate",
title: "Shipped Date",
format: "{0:MM/dd/yyyy}",
width: 200
},
{
field: "OrderID",
title: "ID",
width: 80
}
]
});
$(document.body).css("padding-top", $("#grid > .k-grid-header").height());
var w = $("#grid .k-grid-header-wrap").width();
$("#grid .k-grid-header-wrap").css("width", w - kendo.support.scrollbar());
});
</
script
>
</
div
>
</
body
>
</
html
>
Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Abhishek
Top achievements
Rank 1
answered on 09 Oct 2014, 05:00 AM
Hi Dimo,
I fully understand that it is hackish!. But our scenario is that we want to have scroll on the page instead of on the grid. Also we want to freeze grid headers and support column re-sizing. So what is the best approach to solve this? If you want I can open a support ticket for this?
Thanks a lot in advance.
I fully understand that it is hackish!. But our scenario is that we want to have scroll on the page instead of on the grid. Also we want to freeze grid headers and support column re-sizing. So what is the best approach to solve this? If you want I can open a support ticket for this?
Thanks a lot in advance.
0
Accepted
Hello Abhishek,
Here is a modified version of my previous example, which features improved column resizing and horizontal scrolling support.
http://dojo.telerik.com/ewis
I would like to stress once again upon the fact that the demonstrated implementation is a hack. I still don't see the justification behind using it. Keep in mind that you may encounter undesired side effects, limitations or cross-browser issues.
Regards,
Dimo
Telerik
Here is a modified version of my previous example, which features improved column resizing and horizontal scrolling support.
http://dojo.telerik.com/ewis
I would like to stress once again upon the fact that the demonstrated implementation is a hack. I still don't see the justification behind using it. Keep in mind that you may encounter undesired side effects, limitations or cross-browser issues.
Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Abhishek
Top achievements
Rank 1
answered on 31 Oct 2014, 05:18 PM
Thanks Dimo. The sample solved a lot of issues, though I realize that as you said that this may have some limitations. But this is what is required.
Thanks a lot.
Thanks a lot.
0

Abhishek
Top achievements
Rank 1
answered on 04 Nov 2014, 03:07 PM
Hi Dimo,
One more question on this - is it possible to use grid's virtual scroll using the above solution (having page level scroll bar)? In other words, is it possible to have page level scroll bar and use grid's virtual scroll behavior together?
Thanks a lot.
One more question on this - is it possible to use grid's virtual scroll using the above solution (having page level scroll bar)? In other words, is it possible to have page level scroll bar and use grid's virtual scroll behavior together?
Thanks a lot.
0
Hi Abhishek,
No, using virtual scrolling in this case is not possible.
Regards,
Dimo
Telerik
No, using virtual scrolling in this case is not possible.
Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!