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

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",
        ));

    }

}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.