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
Resizable jqGrid - my solution but needs improving
22/02/2010
02:43
Avatar
wolis
Member
Members
Forum Posts: 5
Member Since:
22/02/2010
sp_UserOfflineSmall Offline

Hi ppl,

My solution to getting a resizable jqGrid is to wrap it in a div that resizable, auto-fix the jqGrid to it, and re-calculate the size of the jqGrid when the div resizes:

  // make the box holding the list resizable..
  $('#'+block+'_box').resizable({ handles: 'e, se' });
  $('#'+block+'_box').resize( function(){
     // TODO: can this resizing calculation be simplified?
     var width = $(this).innerWidth();
     var height = $(this).innerHeight();
     jQuery('#'+block+'_list').setGridWidth(width);
     var pagerHeight   = $('#pg_'+block+'_pager').height();
     var headerHeight  = $('#'+block+'_box .ui-jqgrid-hbox:first').height();
     var titleBarHeight = $('#'+block+'_box div.ui-jqgrid-titlebar:first').height();
     var labelHeight = $('#'+block+'_box tr.ui-jqgrid-labels:first').height();
     var extraBit = titleBarHeight/2;
     headerHeight = parseInt(extraBit+titleBarHeight+labelHeight+pagerHeight); // 73;
     
     $('#gview_'+block+'_list').height(height - pagerHeight);
     $('#gview_'+block+'_list > .ui-jqgrid-bdiv').height(height - headerHeight);

Notice how I have to get the height of some of the jqGrid elements by a class name (eg .ui-jqgrid-hbox:first) as that specific item had no ID defined.

Im sure Im not the first person to want a resizable jqGrid, so what is the prefered method of doing this?

Thanks

22/02/2010
23:23
Avatar
darek_dade
Member
Members
Forum Posts: 5
Member Since:
22/02/2010
sp_UserOfflineSmall Offline

I am working on a treegrid and I need it to be resizable as well!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
72 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