File Location: \app\code\codePool\namespace\module\Block\Adminhtml\module.php
$this->_addButton('exporter', array( 'label' => Mage::helper('exporter')->__('Export Custom Order'), 'onclick' => "setLocation('" . $this->getUrl('*/*/selected', array('page_key' => 'collection')) . "')", 'class' => 'add'
Full code
public function __construct() { $this->_controller = 'adminhtml_exporter'; $this->_blockGroup = 'exporter'; $this->_headerText = Mage::helper('exporter')->__('Order Export'); $this->_addButtonLabel = Mage::helper('exporter')->__('Export All Orders'); $this->_addButton('exporter', array( 'label' => Mage::helper('exporter')->__('Export Custom Order'), 'onclick' => "setLocation('" . $this->getUrl('*/*/selected', array('page_key' => 'collection')) . "')", 'class' => 'add' )); parent::__construct(); }
Now in your controller file: \app\code\codePool\namespace\module\controllers\Adminhtml\moduleController.php
public function selectedAction() { $this->_forward('exportselectedCsv'); } public function exportselectedCsvAction(){ echo "Hii reached"; }
0 Comments