As the subject suggests I'm attempting to alter body width to match the width of the grid in cases where the grid ends up bigger than the body. I'm attempting to do that by wiring up the databound event of the grid and then setting the width of the body. However, the grid's width is returning smaller than it actually is so the body is still left behind.
For example, I have a min-width set on the body element in css. In this case it's 1100px. The grid is reporting its width as smaller than that min-width (1088), yet the grid goes well past that width on the screen. Here is the javascript I am trying to use to accomplish this. Any suggestions?
For example, I have a min-width set on the body element in css. In this case it's 1100px. The grid is reporting its width as smaller than that min-width (1088), yet the grid goes well past that width on the screen. Here is the javascript I am trying to use to accomplish this. Any suggestions?
$(
function
() {
var
grid = $(gridNameForEditors).data(
"kendoGrid"
);
grid.bind(
"dataBound"
,
function
() {
var
grid2 = $(gridNameForEditors);
alert(grid2.width());
document.body.style.width = grid2.width() +
"px"
;
});
})