0

I have some problems with implementing jqGrid with jQuery layouts. The problem is with resizing the grid on browser window resize. The height is working correctly but my problem is width. The grid width won't refresh sometimes. Also, if I close the left pane, the grid doesn't recognize the new width and it keeps the old.

To be short, I need th egrid width to be 100% of window width.

I tried to implement this code to see where my problem was, but the same thing happened. Here are pictures of my problem:

Basic load and Splitter activated.

yoozer8
  • 7,361
  • 7
  • 58
  • 93
Deks
  • 21
  • 1
  • 5

2 Answers2

0

something like:

$(window).bind('resize', function() {
    $("#jqgrid").setGridWidth($(window).width());
}).trigger('resize');
Manuel van Rijn
  • 10,170
  • 1
  • 29
  • 52
0

The value of 100% is not supported for jqGrid width. To achieve the desired result you need to use proper callbacks of jQuery layouts and setGridWidth method:

$('#gridId').jqGrid('setGridWidth', 600);

You can find some samples here: Resize jqGrid when browser is resized?

Community
  • 1
  • 1
tpeczek
  • 23,867
  • 3
  • 74
  • 77
  • Hello, thanks for your replay. I have resize when browser is resized. Please check http://www.phpfreaks.com/forums/index.php?topic=346036.0 – Deks Oct 18 '11 at 15:26
  • As I have wrote you need to use proper callbacks of your layouts plugin, if you are using for example this: http://layout.jquery-dev.net/, then you must add resizing logic to the callbacks described here: http://layout.jquery-dev.net/documentation.cfm#Callback_Functions. I can't give you anything more specific without having access to same actual code. – tpeczek Oct 18 '11 at 20:16