How to make Jqgrid frozen column word-wrap

I am using the latest jqgrid bundle 4.4.5. I want to make header column word-wrap. I read the Oleg answer but seem it's not working with the latest jqgrid.

The error messages that appear in firebug is "$grid[0]._complete" is undefined and when is resize the column the error is "this.grid is undefined".

Is there any solution to make it work?

Edit : after I change $grid.jqGrid('setFrozenColumns'); to $grid.triggerHandler("jqGridAfterGridComplete"); Now when I resize the column, the frozen div column isn't resize too.

Note: I change "this.grid" using local variabel. var grid = this.grid || this;

Here is the image link.


Starting with version 4.3.2 jqGrid supports Events which allows to register multiple callbacks (event handler). Old internal callbacks like _complete were removed.

Instead of the line in the demo

$grid[0].p._complete.call($grid[0]);

you can use now

$grid.triggerHandler("jqGridAfterGridComplete");

UPDATED: The current version of jqGrid have a bug in the line. It will be used this instead of ts:

if($.isFunction(p.resizeStop)) { p.resizeStop.call(this,nw,idx); }

instead of

if($.isFunction(p.resizeStop)) { p.resizeStop.call(ts,nw,idx); }

The event jqGridResizeStop don't have the problem. So I suggest to use it instead:

$grid.bind("jqGridResizeStop", function () {
    resizeColumnHeader.call(this);
    fixPositionsOfFrozenDivs.call(this);
    fixGboxHeight.call(this);
});

See the modified demo.

UPDATED 2: I posted the bug report. I can inform you that the fix is already applied in the main code of jqGrid on the github.

Just published version 4.5.0 includes the fix.