Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Width and MSIE issue
03/02/2009
03:13
Avatar
FredyC
Member
Members
Forum Posts: 17
Member Since:
02/02/2009
sp_UserOfflineSmall Offline

Hi. I had recently discovered this very nice plugin. Solution for width of grid is interesting, but i wonder if there is any way how to archieve standard 100% width. Simply just stretch to full width in container, where grid is held.

I know that because of separated header from data it's not so easy, but is there any realiable way to make this ? Maybe i'm missing something obvious.

I tried simple solution for setting width of grid (using setGridWidth) to the $(grid).parent().parent().innerWidth() and binding to resize event of window for recalcalcute. That works fine in Firefox, but Internet Explorer (6.0) counts that width too later when there is grid already created and container has width computed from grid columns. Yes, i can get width before grid is created, but resizing window creates problem again.

03/02/2009
05:14
Avatar
FredyC
Member
Members
Forum Posts: 17
Member Since:
02/02/2009
sp_UserOfflineSmall Offline

Well, i found a little dirty solution. If you know anything better, please let me know.

$(window).resize(function() {
$grid.setGridWidth(10,false);
$grid.setGridWidth( $grid.parent().parent().width(), true );
});
$(window).resize();

It simply resize grid width to 10px, so the container has right width and then grid is resized to that new width. It works fine, even resizing to 10px isn't visible, but it is “lagging” when i resize window. That's why i call it dirty :)

05/02/2009
01:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I have never try this, but could you please try with setTimeout when in IE.

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.

05/02/2009
03:51
Avatar
FredyC
Member
Members
Forum Posts: 17
Member Since:
02/02/2009
sp_UserOfflineSmall Offline

Well, this kinds of workarounds i really don't like. Giving a user longer time to wait than necessary. I was solving this way a lot of bugs in past, when i didn't understood problem, but it's essentially wrong :)

I was thinking about this and tried another approach. Whole think is wrapped to additional div which i hide (by display: none) on resize. Then IE then thinks, there is nothing and sets corrent width for container. Then i get it, set it and show back again. It seem a little bit cleaner, it's not even lagging, but there is visible resizing of this grid, because of that hiding and showing whole thing. Maybe on some faster computer it will not be so obvious. I tried also setting position of whole think to absolute and then back, but it's same result.

I don't know if there is better way. Initial display is not so much problem, it can be done in initialization time before table is transformed. You just get width of parent and if “width” option is set to 100% then set width of grid to that width of parent.  But resizement problem still needs some hacking, so IE thinks there is nothing in there.

06/05/2009
06:35
Avatar
snobo
Member
Members
Forum Posts: 34
Member Since:
05/03/2009
sp_UserOfflineSmall Offline

FredyC, you've touched a very actual problem, I think (and even saw on this forum) many users wishing, like me, to have the grid stretch the whole width of the container... Yeah, it's an old dilemma "resizable columns + scrollable tbody vs standard html-like table behaviour of 100% stretching".

Please keep us updated about your findings, meanwhile I'm going to experiment in a similar vein, if I find any decent solutions I will share as well...

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
87 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information