Ie 8 - Filter After Item Update In Gridview Gives Old Data

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:

  1. gridview

(see item 1101, has form type 1)

3924

img1.png

  1. filter items by main category (Hlavna kategoria)

(see item 1101, has form type 1)

3930

img2.png

  1. edit item no. 1101

3926

img3.png

  1. change form type of no. 1101 from type 1 to type 3

3927

img4.png

  1. again the gridview, see that form type of item 1101 is correct (3)

3928

img5.png

  1. filter items again by main category (Hlavna kategoria)

and see that item 1101 has wrong form type - type 1, what is the old value before item update

3931

img6.png

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.