0

enter image description herecan we change the frozen column's header height in jqgrid? I did that by:

grid.closest('div.ui-jqgrid-view').find('table.ui-jqgrid-htable th:first-child').css("height", "25px");

but it is not working! any idea?

amanda chaw
  • 137
  • 2
  • 14

1 Answers1

0

You don't posted more full code which you so I have to guess what one need to do in your situation.

In any way one should search for the header of the frozen column in another way. One can do either

var $fhDiv = grid.closest(".ui-jqgrid-view").find(">.frozen-div.ui-jqgrid-hdiv");

or

var $fhDiv = $(grid[0].grid.fhDiv);

To set the height of the header one have to set both the height of the div of the frozen header and the height of the row in which contains the headers:

$fhDiv.height(50).css("z-index", "1");
$fhDiv.find(">.ui-jqgrid-htable .ui-jqgrid-labels").height(50);

One can see that I set z-index of the div of the frozen header additionally. It could be required if you set large enough height value. The value of z-index, which one need to set, could be different depend on where you use jqGrid on your page. The value have to be large enough to place the div of the frozen header over the main grid.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thank you very much for the answer. I attached the image to my question. I did what you posted. It is still like above image. – amanda chaw Nov 17 '14 at 10:09
  • @amandachaw: You are welcome! Sorry, but it's still unclear for me which columns are frozen, how you define the grid and why the problem exist. Could you provide the demo which reproduces the problem or at least to include more details about what you do? – Oleg Nov 17 '14 at 10:23
  • the first column is frozen and all columns are created dynamically. but for some reason the frozen column height is less than others. the codes are too long. I am not sure if this helps! – amanda chaw Nov 17 '14 at 10:35
  • @amandachaw: Sorry, but it's not clear enough. I posted many old answers about fixing the height and the position of the frozen columns. Try [the demo](http://www.ok-soft-gmbh.com/jqGrid/WrappedTextAndFrozenColumns2_.htm). Do you do something like that? – Oleg Nov 17 '14 at 12:18
  • the issue is because there is group header like: $("#enter").jqGrid('setGroupHeaders', { useColSpanStyle: true, groupHeaders: groupH }); in the code. I put sortable: true in the grid, but now frozen column is no longer frozen! I also added $grid.jqGrid('setFrozenColumns'); $grid[0].p._complete.call($grid[0]); based on your answer: http://stackoverflow.com/questions/8564198/why-doesnt-jqgrid-frozen-column-seem-to-work-with-filter-rows-and-filter-headin/8620574#8620574, but it removed group header. – amanda chaw Nov 18 '14 at 07:15
  • @amandachaw: One can't use `setGroupHeaders` and `sortable: true` in the same grid. See [the limitation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:groupingheadar#limitations) of the current implementation of `setGroupHeaders`. – Oleg Nov 18 '14 at 07:48
  • Thank you for the respond. can I do something with the group header and frozen columns, so the frozen column's header not to be like mine (like the image that I posted)? I mean is there a way to fix that issue? – amanda chaw Nov 18 '14 at 08:08
  • @amandachaw: Sorry, but one can't debug the image. You should provide the demo which demonstrate the problem. Do you tried [the demo](http://www.ok-soft-gmbh.com/jqGrid/WrappedTextAndFrozenColumns2_.htm) which I referenced in my previous comment? It uses the last version of jqGrid, jQuery and jQuery UI and it works. Depend on **which version of jqGrid** you use you have to use a little another code. For example `$grid[0].p._complete.call($grid[0]);` will not work because `_complete` is not exist in last versions of jqGrid. – Oleg Nov 18 '14 at 08:32