Can't Get Actiondelete To Redirect

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?

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.

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

You must provide "afterDelete" javascript handler in CButtonColumn definition:

http://www.yiiframework.com/doc/api/1.1/CButtonColumn#afterDelete-detail

or change ‘delete’ button configuration so it become standard link without background AJAX. But the ‘afterDelete’ seems to be just fine.