0

I noticed that if I set autoresizeOnLoad:true, the grid is also doing a resize (to the grid itself) with every call to the server. That might not be an issue (as seems like the desire behavior by the name of the property), but I noticed that the width this new function is using is set during the very first initial load of the grid.

In my case, the grid is wrapped by jQuery UI layout, and so one can play with the layout size. Each time the layout change its width I call to setGridSize, but once the grid is loading the data again, it shrinks (or expand) beyond the layout boundaries to the same width it had when the grid was initiated.

Just wanted to verify it. Unless there might be something wrong on my side. Is the autoresizeOnLoad is locked on a width based on the initialized grid width?

Thanks,

Tal

Oleg
  • 220,925
  • 34
  • 403
  • 798
Tal
  • 391
  • 2
  • 11

1 Answers1

0

I hope that I understand your question correctly. The option autoresizeOnLoad: true follows to resizing of all columns which have autoResizable: true property (and which have no hidden: true or fixed: true property) after loadComplete. If you want stop auto-resizing, for example after explicit call of setGridSize, you can use setGridParam to change the value of autoResizable property. The next reloading of the grid will don't do auto-resizing more.

Alternatively you can use jqGridAfterLoadComplete event to reset the width of the grid after it's changed by autoResizable: true. See the answer or this one and other (like this one too) for examples of the usage of jqGridAfterLoadComplete event.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks, today, if i click on a column for auto resize, it also push the entire grid width. What I want is that a resize will increase on the favor of the over scroll - x of the grid, and not resize the grid itself... also, how do I use the "jqGridAfterLoadComplete " event? – Tal Mar 30 '15 at 11:52
  • @Tal: You are welcome! I think that you mean some very special scenario. The options like `autowidth`, `shrinkToFit`, `width` and other can change the behavior of resizing. You should exactly describe what you do (the demo would be the best) and what you want to have. By the way [the demo](http://www.ok-soft-gmbh.com/jqGrid/OK/autoresizeOnDoubleClickOnColumnResizerWithShrink.htm) shows how one can use column resizing in `shrinkToFit: true` (default) scenario. Try to make double-click in the resizer area of some column. – Oleg Mar 30 '15 at 12:17
  • Is there an event for autoResizable? So that when user double click on a column to get re-sized, I can add some fixing to the overall grid size? I tried to re-create my problem in jFiddle and failed, yet, I'm having an issue to use the shrinkToFit since I ported from 3.7.0 and can't figure why. – Tal Mar 30 '15 at 14:11
  • See here: http://stackoverflow.com/questions/29385548/free-jqgrid-4-8-0-issue-with-autoresize – Tal Apr 01 '15 at 15:20