1

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!!!

Ulug'bek
  • 2,762
  • 6
  • 31
  • 59
Ayyanar G
  • 1,545
  • 1
  • 11
  • 24
  • See the question and answer: http://stackoverflow.com/questions/10005877/yii-framework-async-request – Ulug'bek Dec 05 '14 at 11:58

0 Answers0