protected function _changeActionColumnToAjax(Mage_Index_Block_Adminhtml_Process_Grid $grid) { $grid->getColumn('action')->setActions(array(array('caption' => Mage::helper('index')->__('Reindex Data'), 'url' => array('base' => '*/*/reindexProcessAjax'), 'onclick' => "new IndexerStats.AjaxRequest(this); return false;", 'field' => 'process'))); /* * We use the IndexerStats.AjaxRequest class only for response here, normal Ajax.Request * is hard coded in grid.js as only non-submitting action * * eval'd "complete" value gets used as callback in JavaScript. */ $grid->getMassactionBlock()->setUseAjax(true)->getItem('reindex')->setUrl($grid->getUrl('*/*/massReindexAjax'))->setComplete('(rq = new IndexerStats.AjaxRequest()).onMassComplete.bind(rq)'); }
/** * Change action column to dropdown with additional actions * - schedule reindex * - schedule partial reindex * * @param Mage_Index_Block_Adminhtml_Process_Grid $grid * @return Hackathon_AsyncIndex_Model_Observer */ protected function _changeActions(Mage_Index_Block_Adminhtml_Process_Grid $grid) { $grid->getColumn('action')->setActions(array(array('caption' => Mage::helper('index')->__('Reindex Data'), 'url' => array('base' => '*/*/reindexProcess'), 'field' => 'process'), array('caption' => Mage::helper('index')->__('Schedule Reindex'), 'url' => array('base' => 'asyncindex/asyncindex/index'), 'params' => array('_current' => true, '_secure' => false), 'field' => 'process'), array('caption' => Mage::helper('index')->__('Schedule partial index'), 'url' => array('base' => 'asyncindex/asyncindex/schedulePartial'), 'params' => array('_current' => true, '_secure' => false), 'field' => 'process'))); return $this; }