Yii Framework Forum: CGridView filter sends duplicate AJAX request - Yii Framework Forum

Jump to content

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

CGridView filter sends duplicate AJAX request It happens after hitting the Enter key Rate Topic: -----

#1 User is offline   clapas 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 21-February 11

Posted 07 August 2012 - 10:36 AM

Hello people,

I've just started testing some functionality of the 1.1.11 Yii version with Firefox 11.0, Apache 2.2.22 on Ubuntu 12.04 and found what looks like a bug for me.

I have an index page only consisting of a CGridView like this:

$gv = $this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider' => $model->search(),
    'filter' => $model
));


That is all I have in my view. When I type something in any of the filter inputs and hit Enter, I can see in firebug 2 Ajax calls are issued. On the other hand, if instead of hitting Enter I hit the Tab key, the next input focuses and only 1 Ajax call is made, which looks like the appropiate behavior.

I also tried wrapping the above code with this, to avoid a hypothetical auto-submit. It did not help:

echo CHtml::beginForm('', '', array('onsubmit' => 'return false;'));
echo CHtml::endForm();


I found an old post about a similar issue, but the solution proposed there looks deprecated, as the patch submited is not applicable in my current Yii version.

I hope you have a clue about what is happening. Cheers,

Claudio
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,339
  • Joined: 12-October 09
  • Location:Croatia

Posted 07 August 2012 - 10:44 AM

This is a known issue in 1.1.11 and is already fixed on github...
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   clapas 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 21-February 11

Posted 07 August 2012 - 11:10 AM

Hello mdomba,

thank you for your answer. First of all, i fell sorry for posting on a topic already known to be a bug. How can I avoid this in the future? I mean, should I have searched in the bugtracking system or somewhere else? By the way, what is the easiest way to get a patch for this? Thanks again.

Regards,

Claudio
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,339
  • Joined: 12-October 09
  • Location:Croatia

Posted 07 August 2012 - 11:38 AM

Np... there is a "known issues" thread here - http://www.yiiframew...1-known-issues/

but i think this one was not reported there as we had no time to write it...

To see what is going on, what issues are reported, what is fixed, you need to check the Yii github page, there you can get the fixed code too...

Just click above on "Development" main menu item.

Best regards
Find more about me.... btw. Do you know your WAN IP?
0

#5 User is offline   clapas 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 21-February 11

Posted 07 August 2012 - 12:32 PM

All right! Thank you mdomba. Best regards
0

Share this topic:


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

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