2

is there something called min-width for jq grid? i want my grid to have a minimum width and if the data exceeds the width should be auto adjusted.

thanks.

Devan

Devan
  • 172
  • 1
  • 6
  • 15

1 Answers1

4

The answer on your question depends on how the grid width can be changed in your grid. If you use gridResize then you can just set the corresponding parameters like

$("#list").jqGrid('gridResize', { minWidth: 450, minHeight: 100 });

moreover you can consider to bind 'resize' event to make the changes of grid width if the browser window or the container, where the grid are placed, will be resized. See the answer for details.

Additionally you can consider to set "min-width", "min-height" CSS settings (see here for details) if the change of the grid size will be made not with respect of gridResize. The setting works starting with IE7.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • 1
    $("#list").jqGrid('gridResize', { minWidth: 450, minHeight: 100 }); is not working. i dont know where it has gone wrong. Can i set width directly and set autowidth both together?? – Devan May 17 '11 at 11:52
  • @Devan: Do you included `jquery-ui.min.js` (and not only CSS) in your project? See [the demo](http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGrid3.htm) for example. – Oleg May 17 '11 at 12:21