Well … perhaps it could be available as an option – something like:
jQuery("#grid_id").navGrid("#pager",{standard parameters}).validateParams(true);
|
1 |
<img decoding="async" title="Smile" src="/blog/wp-content/plugins/simple-forum/tinymce/plugins/emotions/img/smiley-smile.gif" border="0" alt="Smile" /> |
Whoops! 
I doubled checked this again … If I set the grid width after hiding the column, then your solution works
$(“#grid”).jqGrid({}).setGridWidth(600, false);
Thanks!
Your suggestion resizes the grid, but not the grid header (
with the class=“GridHeader”). From my example above, after hiding one of the four columns – the three remaing columns take up approx 450 pixels while the header remains 600 pixels. As soon as I resize a column, the header “snaps” to the correct width. I'm guessing that the width of the hidden column (zero pixels) is not being included in the calculation of the grid header width.
Any other solutions?
Either this problem or a related problem seems to be introduced in the 3.3 release …
With jqGrid 3.2.x, if I have a grid with 4 columns, each 150 pixels wide – and
The problem wasn't jqGrid or jQuery – it was a JavaScript problem …
The line if ((requestedPage > lastPage) …
Needs to be replaced with if (eval(requestedPage) > eval(lastPage)) …
Thanks, again!
Hi Tony,
Thanks for the suggestion … unfortunately it doesn't work. Is there any chance that the onpaging event completes before the setGridParam() can update the page value (as this could explain what I am observing)?
Any other suggestions? Thanks!
~ David
I finally found the solution here!
Thanks YamilBracho! I had the same problem (posted here) – but this solves the problem!
I'm not sure if I understand … do I not need to refer to the “pager” in the “jqGrid” attributes if also am using the “navgrid” function?
As for IE, the behaviour is the same as Firefox. I'm sure I'm configuring something incorrectly – I just don't know what! 
Yup, the stylesheets are being correctly referenced:
Using Firefox 3.0, everything in the grid is working properly with no JavaScript errors and only CSS warnings (for IE-specific tags). Only when I add the “navgrid” do I get errors. This is perplexing ….
Even when I manually add all the scripts (as below) rather than using the loader – I get the same error. I also tried moving around script to different loactiosn, but the error still occurs …
The problem only occurs when I add the:
.navGrid('#pager', {
I'll give it a try …
Yup … they are both included. The following four scripts are included:
As you can see, I moved them to a parent directory called “scripts”, but I updated the “jQuery.jqGrid.js” file so that “pathtojsfiles = 'scripts/js/';” – as in documentation. Could this be causing a problem?
Unfortunately I cannot provide a link and I haven't posted the app to a production server. However, I tried a little more experimentation …
If I don't explicitly set the “colModel” value with a width attribute (which defaults to 150 pixels):
|
1 |
<span class="sfcode">{name: 'scientific_name', index: 'scientific_name', sortable: true}</span> |
… then the grid width is ignored when I set:
shrinkToFit: false,
width: 800
|
1 |
However, if I set the "colModel" width attribute to any value, including 150:<br /> |
|
1 |
<span class="sfcode">{name: 'scientific_name', index: 'scientific_name', width: 150, sortable: true}</span>... then the grid is sized correctly. <img decoding="async" title="Smile" src="/blog/wp-content/plugins/simple-forum/tinymce/plugins/emotions/img/smiley-smile.gif" border="0" alt="Smile" /><br /> |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top