JQGrid autoheight works well if you have less number of columns that fit inside a browser window, but if your grid has too many columns with a horizontal scroll bar then you might have an issue. I have been using JQGrid "forceFit" parameter that generates a a horizontal scroll bar in order to display all columns which is great and mostly all browser. But IE 8 & IE 9 compatibility view does display a vertical scroll bar.
So the following snippet can be used to fix this:
var GBDIV = jQuery('#invoicesGrid').parents('.ui-jqgrid-bdiv'); if(GBDIV.length > 0) { var hvScroll= GBDIV[0].scrollHeight > GBDIV[0].clientHeight; if(hvScroll){ var gridHeight = jQuery('#invoicesGrid').height(); jQuery('#invoicesGrid').setGridHeight(gridHeight + rowHeight); } }
The above code should be added to "loadComplete" event of your JQGrid
A computer would deserve to be called intelligent if it could deceive a human into believing that it was human. Alan Turing Read more: http://www.brainyquote.com/quotes/keywords/computer.html#ixzz1mMy5nFqD
Great Article
ReplyDeleteASP.NET MVC Training
Online MVC Training
Online MVC Training India
Dot Net Training in Chennai
.Net Online Training
.net training online
Dot Net Online Training
C# Training