Blogger Widgets
  • Sharing Photos using SignalR
  • TFS Extenstion - allows copy work items between projects
  • Displaying jquery progressbar with ajax call on a modal dialog
  • Managing windows services of a server via a website
  • Exploring technologies available to date. TechCipher is one place that any professional would like to visit, either to get an overview or to have better understanding.

Search This Blog

Tuesday 14 February 2012

JQGrid Autoheight not working on IE 8 and IE 9 compatibility

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

1 comments:

Copyright © 2013 Template Doctor . Designed by Malith Madushanka - Cool Blogger Tutorials | Code by CBT | Images by by HQ Wallpapers