I’m using the new API to set the width of my jqGrid like this:
$('#grid').jqGrid('setGridWidth', $(window).width() * 0.98);
The problem is that in IE7 I’m getting this error:
‘p.cellLayout’ is null or not an object
This only happens in IE7 (IE8, Firefox and Chrome work fine). Has anybody else encounter this problem and fixed it?
Probably you try to use
setGridWidthfunction on the wrong place. I would recommend you to place this call inside ofloadCompleteorgridCompleteevent.UPDATED: I have no IE7, so I can not test this problem. There are parameter
cellLayoutof jqGrid which has default value 5 and is documented on http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options. This parameter are used inside ofsetGridWidthfunction. If is not clear you me why this parameter should benull, but you can verify this before calling ofsetGridWidth. The constructalert($('#grid')[0].p.cellLayout);will show you this value. You can try to set this value to 5 before calling ofsetGridWidth, but if you really have this property asnull, you have definitively a problem somewhere else.In all situations like your problem it is always good to post a code example in your question, so that other could reproduce your problem. Sometimes you have a real problem not on the place which you describe. So a code example is always very helpful.