I have a UI that shows a CRUD(create, read, update and delete) account of an employee. Now, I want to add a generate button that when its click, a window will pop-up that will show and ask if the following data in the grid lines under the UI are to be open or saved using the excel report.Also, I have already EXcelPhp library. 
Here's my code for my 'actions.class.php':
public function executeLoadEmployeeList(sfWebRequest $request)
{
    // $start = $request->getParameter('start') ? $request->getParameter('start'): 2;
    // $limit = $request->getParameter('limit') ? $request->getParameter('limit'): 2;
    $query = pg_escape_string($request->getParameter('query'));     
    $start = $request->getParameter('start');
    $limit = $request->getParameter('limit');
    if(isset($limit))
    {
        $page = $start / $limit;
        $page ++;
    }
    else
        $page = 1;
    $criteria = Doctrine_Query::create();//what is the query?? is it select,inset,update,delete?
    $criteria->select("(fname || ' ' || lname)  AS fullname, department");
    $criteria->from('Employees'); // Select * from profile
    $criteria->orderBy('id'); // order by id
    //print $criteria->getSqlQuery();
    //die();
    if($query!=null)
      {
        $criteria->where("(fname ilike '%$query%' or lname ilike '%$query%' or department ilike '%$query%')"); //where (uname ilike '%$query%' or status ilike '%$query%')
      }             
    $allData = $criteria->fetchArray();
    // print "<pre>";       
    // print_r($allData);
    // die();   
    $this->pager = new sfDoctrinePager('Employees', 20); //what is sfdoctrine about? dont mind this.. this is a symphony built in class for pager
    $this->pager->setQuery($criteria);
    $this->pager->setPage($page);
    $this->pager->init();//What is the purpose of this line? //initialize sfDoctrinePager
    $result['data'] = $this->pager->getResults();
    $result['totalCount'] = count($allData);
    $result['limit'] = $limit;
    $result['page'] = $page;
    $result['query'] = $query;
    die(json_encode($result));      
}
public function executeAddEmployee(sfWebRequest $request)
{
    try{
        $fname = $request->getParameter('fname');
        $lname = $request->getParameter('lname');
        $department = $request->getParameter('department');
        $Employee = new Employees();
        $Employee->fname = $fname;
        $Employee->lname = $lname;
        $Employee->department = $department;
        //save the data to the database
        $Employee->save();
        $data = array("success"=> true, "data"=>"Employee Added.");
    }
    catch(Exception $e)
    {   
        $data = array("success"=> false, "data"=>$e->getMessage());
    }     
        //$data is a return value of trycatch
        die(json_encode($data));
}
public function executeDeleteEmployee(sfWebRequest $request)
{
     try{
        //what is Doctrine::getTable's purpose // to get the table profile
        $this->forward404Unless($Employee = Doctrine::getTable('Employees')->find(array($request->getParameter('id'))), sprintf('Employee ID in Form does not exist (%s).', $request->getParameter('id')));     
        $Employee->delete();
        $data = array("success"=> true, "data"=>"Employee record is Deleted.");
     } catch(Exception $e) {
        $data = array("success"=> false, "data"=>$e->getMessage());
     }
        //$data is a return value of trycatch
        die(json_encode($data));
}
public function executeEditEmployee(sfWebRequest $request)
{
    try{
        $this->forward404Unless($Employee = Doctrine::getTable('Employees')->find(array($request->getParameter('id'))), sprintf('Employee ID in Form does not exist (%s).', array($request->getParameter('id'))));
        $criteria = Doctrine_Query::create();
        $criteria->select('fname,lname,department');
        $criteria->from('Employees');
        $criteria->where('id = ?', $request->getParameter('id'));//('id = ?', $request->getParameter('id') means... id = $request->getParameter('id')
        $result = $criteria->fetchArray();
        $record['fname'] = $Employee['fname'];
        $record['lname'] = $Employee['lname'];
        $record['department'] = $Employee['department'];
        $data = array("success"=> true, "data"=>$record);
    } catch(Exception $e) {
        $data = array("success"=> false, "data"=>$e->getMessage());
    }     
        //$data is a return value of trycatch
        die(json_encode($data));
}
public function executeUpdateEmployee(sfWebRequest $request)
{
    try{
        $Employee = Doctrine::getTable('Employees')->find(array($request->getParameter('id')));        
        $Employee->fname = $request->getParameter('fname');
        $Employee->lname = $request->getParameter('lname');
        $Employee->department = $request->getParameter('department');
        //save the update to the database
        $Employee->save();
        $data = array("success"=> true, "data"=>"Employee Successfully Updated.");
    }
    catch(Exception $e)
    {
        $data = array("success"=> false, "data"=>$e->getMessage());
    }     
        //$data is a return value of trycatch
        die(json_encode($data));
}
public function executeGenerateEmployee(sfWebRequest $request)
{
    // ...
}**
What I've tried so far is setting only the generate button and there's no action yet. This is under my try.js:
var generateItem = new Ext.Action ({
  text: 'Generate Excel Report',
  width: 60,
  enabled: true,
});
Could someone help me regarding this issue?
 
     
     
    