Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to make jqGrid stretch to 100%?

Is it possible to make it so that a jqGrid will have a width set to 100%? I understand that column widths must be an absolute pixel size, but I've yet to find anything for setting the width of the actual grid to a relative size. For instance, I want to set the width to 100%. Instead of 100% it seems to use an odd size of 450px. There is more horizontal room on the page, but with the columns width and such, it will make the container(of only the grid) horizontally scroll. Is there some way around this?

like image 758
Earlz Avatar asked Jun 16 '10 16:06

Earlz


People also ask

How to set jqGrid column width in percentage?

If you are wanting to set the width of the entire grid to a percentage you can use the autowidth property and it will set the grids width to the width of it's parent element (i.e. DIV) and that parent element can have it's percentage set.

How do you hide jqGrid?

Just set opacity:0 for jqgrid element. it will work also.

How do you use jqGrid?

In this step, we are going to add jqGrid Script and CSS reference to index view. This script is added to project when we add jqGrid Grid from NuGet package. After adding Scripts and Css next we need to add table element for reserve the place where the grid should be created.


2 Answers

autowidth: true from 3.5 onwards

like image 88
johnjohn Avatar answered Sep 25 '22 07:09

johnjohn


It works for me:

width: null, shrinkToFit: false, 
like image 28
user1697051 Avatar answered Sep 25 '22 07:09

user1697051