Forum
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:
$('#'+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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66