Hi,
I would like to ask, whether has someone dealt with the problem of using filter in CGridView in IE8. It works fine, but after updating an item and then using the filter again, old data are shown.
Any help would be appreciated!
Hi,
I would like to ask, whether has someone dealt with the problem of using filter in CGridView in IE8. It works fine, but after updating an item and then using the filter again, old data are shown.
Any help would be appreciated!
Just for confirmation, does it work fine with Firefox or Chrome?
And could you explain a bit more about "updating", "filter" and "old data"?
Yes it works fine in other browsers.
Example:
(see item 1101, has form type 1)
3924
(see item 1101, has form type 1)
3930
3926
3927
3928
and see that item 1101 has wrong form type - type 1, what is the old value before item update
3931
I see.
I wonder what’s wrong …
Might be a problem with the browser cache? Or did you set CGridView’s ‘enableHistory’ property to true?
I didn’t set ‘enableHistory’ to true. I’m not sure if it’s IE cache, but even if it is, I have it in default settings, same as application users will have. Therefore must force the reload by application…
Any hints?
No clue so far. I haven’t experienced the things like this.
Could you show us the minimum code to reproduce the problem?
It’s code generated by gii CRUD generator,
and in view I added selectbox filters as follows:
'columns'=>array(...
array(
'name'=>'FormTypeID',
'header'=>'Formulár',
'value' => 'FaqFormType::model()->getNameByPK($data["FormTypeID"])',
'filter' => CHtml::listData(FaqFormType::model()->findAll(), "ID", "Name"),
'htmlOptions'=>array('style'=>'width:80px;'),
),
...
this might not be necessary, just to be complete,
in FaqFormType model I have
public function getNameByPK($pk)
{
$fform = $this->findByPK($pk);
if(is_null($fform))
return '';
else
return $fform->Name;
}
What about the data in db?
Does it hold the right content even when the GridView displays the wrong data? Or does it get changed back to the previous content?
Anyway, probably you have to trace the source code in operation and see what’s happening …
After all, I managed to solve this issue.
In framework/zii/widgets/grid/CGridView.php
I’ve changed line 133
from
public $ajaxUpdate;
to
public $ajaxUpdate = false;
which turns off ajax. Then it worked correctly in IE8.
Thanks everyone for their time.