Forum
00:26
10/08/2009
Hello Tony,
I described the problem with the fix ealy in the answer, but forgot to post it in the forum.
The problem is easy. The current code of showHideCol increase or decrease correctly the grid width only in case of shrinkToFit===false. In the code will be corrected adjusted the value of $t.p.tblwidth in the line, but the value will be just ignored in the following line.
To fix the problem I suggest modify the line
to the following
and modify another line
to
It's all the bug ifself. Another issue described in the answer is more the changing of behavior on the column resizing.
The resizeStop described in the answer
var $grid = $(this.bDiv).find('>:first-child>.ui-jqgrid-btable:last-child'),
shrinkToFit = $grid.jqGrid('getGridParam', 'shrinkToFit');
$grid.jqGrid('setGridWidth', this.newWidth, shrinkToFit);
}
I use personally always since I wrote the answer. I like the behavior because I don't specify width parameter of the grid and want to hold the width of grid as the sum of the width of all columns. So it's logical to increase or decrease the width of the grid after resizing of the column. As the result one have grid which never have any horizontal scroll bar.
To make common solution from the above code one can just save the original value of the width parameter of the grid in for example orgWidth parameter. In the case one can test it inside of dragEnd (somewhere before calling of resizeStop) and do the same as above in case if orgWidth parameter converted to int is NaN.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
47 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