jqgrid questions
Posted
by
user508518
on Stack Overflow
See other posts from Stack Overflow
or by user508518
Published on 2011-01-04T21:50:46Z
Indexed on
2011/01/04
21:54 UTC
Read the original article
Hit count: 154
Hi All-
I recently posted a question on SO on freezing columns in jqgrid(http://stackoverflow.com/questions/4586924/jqgrid-freeze-columns). I got the following solution to be working in IE8, but its not all perfect:
I set to use two css classes, one for header and other one for the rows like below:
.jqgridbodyLock{
position:relative;
left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft);
z-index: 10;
}
.jqgridheaderLocked{
position:relative;
left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft); /* IE5+ only */
z-index:30;
}
Then in colModel, I used the property classes
{name:'column1', width:100, index:'column1', sorttype:"string", classes:'jqgridbodyLock'},//lock the body row
and to lock the respective header I used code as below:
$("#grid").setLabel("column1","column1","jqgridheaderLocked");
Though the solution works, I have the following problems:
1) The header values shake a lot when scrolling to the right though they remain frozen
2) The body values of the frozen column disappear when the cursor is taken out of the grid.
3) How to lock a normal table in firefox. I see that 'expression' is exclusive only to IE browser
Thanks a lot
© Stack Overflow or respective owner