1

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

asked Jul 1, 2016 at 11:25

1 Answer 1

4

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.