Error Deleting on CGridView

Hi!, I’m working on a GridView but I have a problem when I try to delete a record from delete botton in the grid, only happens on IE, on firefox and chrome works fine!.

I think the problem is when the jquery tries to update the table after deleting the record, because delete the record but sometimes it didn´t update the table correctly or update it with other records that didn´t exist on the database and it was deleted before. I think that could be some cache error but I didn’t know where find it and what to modify to fix it.

The controller and model doesn’t have something diferent form the base code generated for gii.

I added some screenshots from my app.

I would appreciate every help you could give me.

Before Delete:

2041

sinBorrar.jpg

After Delete:

2042

luegoBorrar.jpg

if I updated with F5:

2043

f5Borrar.jpg

I think it could be of great help if you could also show the delete action of your Controller and Model delete function

sorry, I forgot that little detail jeje!..

This is the code of my view:


<?php $this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'proveedor-grid',

	'dataProvider'=>$model->search(),

	'filter'=>$model,

        'pager'=>array(

                'header' => false,

                'class'=>'CLinkPager',

                'nextPageLabel' => '>',

                'prevPageLabel' => '<',

                'firstPageLabel' => '<<',

                'lastPageLabel' => '>>',),

	'columns'=>array(

		'nombre',

		array(

			'class'=>'CButtonColumn',

		),

	),

)); ?>



and this is the delete action in my controller




public function actionDelete($id)

{

     if(Yii::app()->request->isPostRequest)

     {

	$this->loadModel($id)->delete();


	if(!isset($_GET['ajax']))

	      $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));

     }

     else

         throw new CHttpException(400,Yii::app()->params['msg400']);


}




this happens only after the second time that I had tried to delete some record :S

I was testing yesterday and this happen on every gridview I have, and when i´m deleting from the gridview, if someone could help me I would really appreciate it. please!

This "problem" is very strange… the code you posted is OK… should be something else…

To be sure it’s something in your application… I would suggest you to create a new Yii webapp… and in that one create the CRUD for any table… then check if here is all working…

Wow, strange thing… If IE is actually redirecting to a ‘cached’ source page… Can you try the following: on the actionDelete, can you include a new parameter to the redirect function that adds a time() value to the end of the URI string? I am curious about its result