0

I am adding phpGrid tables in my site. I want the grids to be closed by default, but consulting the documentation I cannot find any argument to set this on initialization.

The grid is closed manually by clicking on an tag with the class "ui-jqgrid-titlebar-close". Using the following code at the bottom of the page I was able to get all of the grids closed up.

$(function() {
    // set the data-grids to appear closed by default
    $('.ui-jqgrid-titlebar-close').trigger('click');
    ...
} );

This works in Chrome, Firefox and IE9. Unfortunately this website is meant for internal access and IE9 falls back to "IE8 Standards mode" for intranet sites. In IE8 the click event has no effect.

Any ideas how to close my phpGrids in IE8?

4

1 に答える 1

0

Matt,

I have faced a similar issue before where IE defaults to compatibility mode for any intranet site and it is frustrating. You have a couple of options however.

If you have access to the web server, you can set the meta tag on your site properties, I did it on IIS, not sure about other web servers. But basically you need to add a Custom HTTP header where the name is X-UA-Compatible and the value is IE=9 (or edge if you prefer)

The other option is to include an IE shim (or shiv)

So using conditional comments you can do this

<!--[if lt IE 9]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->

This script augments your browser capability to make it behave like IE9

于 2012-08-29T16:27:30.833 に答える