0

Can I disable ajax Update in CGridView only on Internet Explorer < 10?

Manquer
  • 7,390
  • 8
  • 42
  • 69
Eugene
  • 143
  • 1
  • 15
  • Browser detection is [commonly frowned upon](http://stackoverflow.com/questions/1294586/browser-detection-versus-feature-detection). What is your aim here? Perhaps feature detection is a better way to approach the problem? – Jon Apr 25 '13 at 10:15

2 Answers2

0

You can get IE version manualy and add use in widget:

$isIE10 = !preg_match('/(?i)msie [1-9]/',$_SERVER['HTTP_USER_AGENT']);

$this->widget('zii.widgets.grid.CGridView', array(
        .................
        'ajaxUpdate' => ($isIE10?'id':false),
        .................
));
Narek
  • 3,813
  • 4
  • 42
  • 58
0

You may also use jQuery's $.browser to detect it.

var ua = $.browser;
if ( ua.msie && parseInt(ua.version, 10) < 10 ) {
  alert( "Disable AJAX!" );
}

Note: Example untested, build from examples on linked site.

schmunk
  • 4,708
  • 1
  • 27
  • 50