Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the header height in jQuery grid?

Tags:

jquery

jqgrid

I have a jQuery grid, with 5 columns. My column name is too large so I defined something like this in my jQuery grid:

Information about <br/> customers bioData

In my jQuery column I am seeing "Information about" but I am not able to see "Customers BioData".

How can I set the header height?

like image 523
user354625 Avatar asked Jun 14 '10 22:06

user354625


2 Answers

If you are referring to jqGrid, it looks like the fix is a CSS tweak as per the following articles:

http://www.trirand.com/blog/?page_id=393/help/grid-header-height/ http://2centtech.blogspot.com/2009/12/jqgrid-header-and-cell-value-word-wrap.html

.ui-jqgrid .ui-jqgrid-htable th div {
    height:auto;
    overflow:hidden;
    padding-right:4px;
    padding-top:2px;
    position:relative;
    vertical-align:text-top;
    white-space:normal !important;
}

Edit: As rd22 found out in the comments, it seems that some versions of jqGrid may have an !important flag on the height rule (and possibly others?). So if you find that the above CSS does not work, that may be why. Just change the above rules to include height:auto !important and you should be good to go.

like image 115
Bradley Mountford Avatar answered Oct 11 '22 12:10

Bradley Mountford


Excellent but for IE, you also need to add the below in addition to above class.

.ui-jqgrid table.ui-jqgrid-htable {
    height:30px;
} 
like image 37
Hitesh Patel Avatar answered Oct 11 '22 11:10

Hitesh Patel