How do you set width to 90%
//$grid["forceFit"] = true;
//$grid["shrinkToFit"] = true;
//$grid["autowidth"] = true;
//$grid["width"] = "2000";
$grid["width"] = "90%";
I have tried a lot of setting but none seem to give me a grid that fits my page.
I would like to set the size to 90% of the page…
Also on my site its in a frame that seems to push it off the page for full size…
http://www.bradyfamilytree.org/genealogy/1859-searchgrid2.php
Regards
Darryl
I would recommend to set
$grid["autowidth"] = true;
And then place the grid output var in a <div>
<div style='width:80%'>
<?php echo $out; ?>
</div>
I tested following code on chrome, and working as expected.
Hi there,
This does not work for me in Chrome. I've set the options and the grid always is 100% width of the screen, no matter what container I have it in and the width of the container.
Has this been a recent fix?
Cheers,
Craig.
Thanks Abu,
I'll give it a test – at a quick glance, my code appears to be identical, but there is obviously something not correct.
Cheers,
Craig.
Hi Abu,
I've just checked this and you are correct – your example works for the initial load. However, if I set the width of the wrapper/container to 90% of the browser width, the wrapper/container flows with the width of the brwser, but the grid does not. It stays the originally loaded width. Then, on refresh, the size is re-calculated.
Also, the grid doesn't appear to honor the margin CSS tag, but does honor the padding tag.
These are the 3 options I'm using/testing (hopefully correctly):
$grid["forceFit"] = true;
$grid["autowidth"] = true;
$grid["autoresize"] = true;
<div style="width: 90%; border: 1px solid red;">
<?php echo $out; ?>
</div>
Cheers,
Craig.
It's the $grid["autoresize"] = true which is causing the problem.
If this is true, the grid doesn't honor the container width, and if it's false, it honors the container width but doesn't resize (obviously).
Would really like "autoresize" and honor container width please!
For anyone else looking at this, the issue turned out to be a combination of issues.
Firstly, I had nested containers each with varying margins/padding.
Secondly, it appears that jqGrid does not correctly honor the margin/padding of containers more than 1 level higher (ie. parent's parent).
I ended up having to remove the padding/margin from the top level containers to make this work "properly".
Hello there. I have the same problem that Craig had, but i still don´t find a solution. The grid doesn´t fit the page. I use bootstrap 3.
The problem is that the grid doesn´t respect the width of it´s containers.
Can anyone help me!.
Here is my code: http://pastebin.com/HjRXmqB9
Thanks.
Sebastián Montemaggiore.