Forum


17:44

12/06/2009

Hi,
I am trying to set the width on two grids that I have on the same page using the setGridWidth method. The problem I'm finding is that the width for the first grid will be set but, the second grid width will not be set. Any help would be appreciated. Following is the code I'm running:
$('#gridOne').setGridWidth($('#tab-1').width());
$('#gridTwo').setGridWidth($('#tab-2').width());
(Each grid is placed inside a JQueryUI tab).
Thx.
02:42

Moderators
30/10/2007

Hello,
The width of the hidden element is always 0 as of jquery 1.3.2. Also if your second tab is hidden you can not use width in order to set it in the grid.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:16

12/06/2009

So, I removed both grids from the JQuery Tab elements to remove the zero element width issue. I also changed the width to be width of the window (ie: $(window).width();) After making this change I found that still only the first grid will change the width and the second won't. To verify this I modified the order of which grid width was being set first.
Thanks,
Craig
21:30

13/06/2009

Hi,
I've got the same problem…
…but first, as this is my first post, can I say thank you Tony for a wonderful component – it really is quite special – and also thanks to the other posters who have assisted me in solving most of the issues I have had since discovering jqGrid a few weeks ago.
Anyway back to the original topic. I've got an Accordion with one grid on page 1 and 2 grids on page 2. All are set to autowidth:true and when the page first loads grids 1 & 2 size to the Accordion width but grid 3 doesn't.
I've also got the Accordion on the East Pane of a UI-Layout setup which when that pane is resized (by dragging the left hand border) the Accordian resizes and then calls a function that should resize the grids. Only the 1st grid called to be resized does – I've left the 1st grid out of this call in my example to show that it does size correctly on load and not as a result of a call to that function after the grids have been setup.
Here's the test page that shows all this going on..
http://www.thekmz.co.uk/GEPlug.....etest1.htm
I think this is the same issue the OP has.
(As an aside the image I have as the column name in grid 3 looks fine on FF & IE6 but doesn't vertically align in IE7 – a minor thing I'd also like to solve)
Again thanks Tony for this fantastic plugin – and hope you can help in solving the above. (I'm using 3.5 if that makes any difference)
Regards
Romyn
(edit - just checked the Col header image and it seems ok on IE7
need to reproduce the problem from my full page as a separate post)
10:32

Moderators
30/10/2007

Hello Romyn,
Thanks - it is a bug in setGridWidth method. Also fixed in GitHub.
Thanks again for this investigation
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
21:09

13/06/2009

Thanks Tony - glad I could help in some small way.
Amended the example link above (as well as including the first grid in the accordion resize) and all 3 grids now resize correctly
As an aside I was originally using the mim-ed version and to get this to work had to download all the separate files from github - is that right? and the mim-ed build is only updated occasionally.
Anyway great stuff
Romyn
Most Users Ever Online: 715
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66