Hello to all this is my first post here
I am in trouble here and in desperate need for help!
I am having problem using the CGridView widget in IE8 and bellow versions.
–problem number 1 is: when I click in one of the pagers numbers (to change to the next results) the GridView content disappear.
–problem number 2 is: I need that the gridview keep refreshing via ajax so I set up the following code:
Yii::app()->clientScript->registerScript('update_ajax_all', "
var t = self.setInterval(\"$.fn.yiiGridView.update('pool-grid')\", 7000);
", CClientScript::POS_LOAD);
code above works fine in firefox, chrome, opera and IE9 but not in IE7 and neither in IE8.
I looked at the following posts in this forum that are similar to my problem:
post 1
post 2
post 3
I tried the solution in the first post but nothing worked.
I double checked the versions that are being loaded by the browser:
Yii framework is 1.1.10 (I also tried in 1.1.8 and the problem persists)
Jquery is 1.7.2 ( I also tried with 1.7.1 and the problem persists)
I tried tweaking the file yii-1.1.10/framework/zii/widgets/assets/gridview/jquery.yiigridview.js
Code bellow is the one that starts at line number 80 in the original jquery.yiigridview.js
if (settings.ajaxUpdate.length > 0) {
//original is commented just bellow:
// $(document).on('click', settings.updateSelector, function () {
//bellow is hack
$(document).on('change', settings.updateSelector, function () {
$('#' + id).yiiGridView('update', {url: $(this).attr('href')});
return false;
});
}
//BELLOW is the original
// $(document).on('change', inputSelector, function () {
//following line added by CANELAS to try to deal with bug in IE:
// $(document).on($.browser.msie? 'click': 'change', inputSelector, function () {
$(document).on('click change', inputSelector, function () {
var data = $(inputSelector).serialize();
if (settings.pageVar !== undefined) {
data += '&' + settings.pageVar + '=1';
}
$('#' + id).yiiGridView('update', {data: data});
});
//bellow lines is hack to make work in IE but does not works
/*
if($.browser.msie || $.browser.opera) {
$(document).on('click', inputSelector, function(event){
var data = $(inputSelector).serialize();
if (settings.pageVar !== undefined) {
data += '&' + settings.pageVar + '=1';
}
$('#' + id).yiiGridView('update', {data: data});
}
}
// */
/*
if($.browser.msie ) {
$(document).on('keypress', inputSelector, function(event){
if(event.keyCode == 13) {
var data = $(inputSelector).serialize();
if (settings.pageVar !== undefined) {
data += '&' + settings.pageVar + '=1';
}
$('#' + id).yiiGridView('update', {data: data});
}
}
}
// */
Anyone has any idea? help would be greatelly apreciated!