0

I have my admin grid container working and I have added a button to the top right of the page using this:

class My_Class extends Mage_Adminhtml_Block_Widget_Grid_Container
{
    public function __construct()
    {
        ...

        $this->_addButton(
            'email',
            array(
                'label' => Mage::helper('adminhtml')->__('Email'),
                'onclick' => "alert('foo bar')"
            ),
            -100);
    }
}

When I click the button I see the JS alert popup.

What I want to do instead of alert is make an AJAX call that executes an admin route that sends back some JSON. What's the best approach?

Your Answer

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

Browse other questions tagged or ask your own question.