Yii Framework Forum: Can't Get Actiondelete To Redirect - Yii Framework Forum

Jump to content

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

Can't Get Actiondelete To Redirect Rate Topic: -----

#1 User is offline   filthy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 27-January 12

Posted 08 January 2013 - 11:01 AM

Hi, I just can't see what's wrong. INexperience probably.

Standard code generated by GII. IN the controller, i have an actionDelete method. SO when, in CGrigView, a user clicks the delete button, this calls actionDelete and deletes the model.

Problem is i want to actually completely refresh the screen/reload the app completely. The reason behind this is that the main layout calls menu functionnality that needs to be re-run. I can't get it to work.

If i do a redirect,

$this->redirect(.....)


it only refreshes the grid. What am i missing?
0

#2 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 788
  • Joined: 02-July 10
  • Location:Central Poland

Posted 08 January 2013 - 02:10 PM

You missed the fact, that Zii grid does AJAX request to delete record by default. This means that your redirect only changes what is returned by AJAX request, but that does not replace currently displayed page.
red
0

#3 User is offline   filthy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 27-January 12

Posted 08 January 2013 - 02:55 PM

ok i get it. So then my question becomes: How do i force a complete window refresh?
0

#4 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 788
  • Joined: 02-July 10
  • Location:Central Poland

Posted 08 January 2013 - 04:09 PM

You must provide "afterDelete" javascript handler in CButtonColumn definition:
http://www.yiiframew...erDelete-detail

or change 'delete' button configuration so it become standard link without background AJAX. But the 'afterDelete' seems to be just fine.
red
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