Yii Framework Forum: Ie 8 - Filter After Item Update In Gridview Gives Old Data - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   flowerlee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-February 13

Posted 12 March 2013 - 09:17 AM

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! :)
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 12 March 2013 - 11:01 AM

Just for confirmation, does it work fine with Firefox or Chrome?
And could you explain a bit more about "updating", "filter" and "old data"?
0

#3 User is offline   flowerlee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-February 13

Posted 13 March 2013 - 05:11 AM

Yes it works fine in other browsers.
Example:
1. gridview
(see item 1101, has form type 1)
Attached File  img1.png (14.46K)
Number of downloads: 7

2. filter items by main category (Hlavna kategoria)
(see item 1101, has form type 1)
Attached File  img2.png (20.3K)
Number of downloads: 6

3. edit item no. 1101
Attached File  img3.png (9.79K)
Number of downloads: 4

4. change form type of no. 1101 from type 1 to type 3
Attached File  img4.png (9.79K)
Number of downloads: 4

5. again the gridview, see that form type of item 1101 is correct (3)
Attached File  img5.png (14.85K)
Number of downloads: 5

6. 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
Attached File  img6.png (20.33K)
Number of downloads: 6
0

#4 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 13 March 2013 - 06:44 AM

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?
0

#5 User is offline   flowerlee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-February 13

Posted 13 March 2013 - 08:14 AM

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?
0

#6 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 13 March 2013 - 11:28 AM

No clue so far. I haven't experienced the things like this.
Could you show us the minimum code to reproduce the problem?
0

#7 User is offline   flowerlee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-February 13

Posted 14 March 2013 - 07:50 AM

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;
	}

0

#8 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 15 March 2013 - 06:43 AM

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 ...
0

#9 User is offline   flowerlee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-February 13

Posted 30 March 2013 - 06:38 AM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users