I am using Yii ERunActions to delete huge files in background, it works as gem but after deleting files it doesn't return to ajax success, where I refresh grid after deleting files, I dont know where I made mistake ??
Controller Action :
public function actionBCDelete()
{
if (ERunActions::runBackground())
{
Campaign::model()->deleteAllByAttributes(array("crm_filter_id"=> $_POST["id"]));
FilterModel::model()->deleteByPk($_POST["del_id"]);
SourceModel::model()->deletebyPk($_POST["del_source"]);
}
}
Ajax call:
$.ajax({
type: "POST",
url: "'.$this->createUrl("baseContact/BCDelete").'",
data: {"id" : fileid ,"del_source" : del_source , "del_id" : del_id },
async:true,
success: function(data){
$.fn.yiiGridView.update("basefilter-grid");
},
error: function(data){
alert("Failure");
}
});`
Controller action returns to success before deleting files , but i want to return to success after deleting all files for grid to refresh, can anyone guide me to make it work!!!