I'm creating a custom module where i have a requirement to add a upload button to the Grid container for uplaoding a csv file and execute it to update a attribute value in the database. how do i achieve this.enter image description here
1 Answer 1
Add button as per following:
class XYZ_Brand_Block_Adminhtml_Brand extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
$this->_controller = 'adminhtml_brand';
$this->_blockGroup = 'brand';
$this->_headerText = Mage::helper('core')->__('Sample Text');
parent::__construct();
$this->_removeButton('add');
$this->_addButton("Import", array(
"label" => Mage::helper("core")->__("Import"),
"onclick" => "location.href = '" . $this->getUrl('brand/adminhtml_import') . "';",
"class" => "btn btn-danger",
));
}
}
answered Dec 30, 2016 at 8:06
sandip
4,0643 gold badges29 silver badges57 bronze badges
default