I am trying to add a grid in my admin form tab. the idea is that the top part of page will hold the form and the bottom part will have the grid.

example of it is: enter image description here

I obtained the instructions on how to do this from here

In summary I added a renderer via the $fieldset->addType to my form.

The form rendered okay, but no grid.

example code

$fieldset->addType('customer_grid', 'test_testmodule_Block_Adminhtml_config_Edit_Form_Renderer_Fieldset_config');


class test_testmodule_Block_Adminhtml_config_Edit_Tab_config extends Mage_Adminhtml_Block_Widget_Form
    protected function _prepareForm()
        $form = new Varien_Data_Form();

        # add a fieldset, this returns a Varien_Data_Form_Element_Fieldset object
        $fieldset = $form->addFieldset('base_fieldset', array(
            'legend' => Mage::helper('test_testmodule')->__('test')

> 'test_testmodule_Block_Adminhtml_config_Edit_Form_Renderer_Fieldset_config');

   .......Form Fieldsets 

         return parent::_prepareForm();

I then created a page for creation of form grid.

    public function getElementHtml()
        return Mage::helper('core')->getLayout()->createBlock('test_testmodule/adminhtml_payment_edit_form_renderer_fieldset_config_grid')->toHtml();


I created the grid page.

class test_testmodule_Block_Adminhtml_config_Edit_Tab_config_Grid extends Mage_Adminhtml_Block_Widget_Grid

    public function __construct()

    protected function _prepareCollection()
      $collection = Mage::getResourceModel('test_testmodule/config')->getCollection();      
      return parent::_prepareCollection();

    protected function _prepareColumns()
    ..........collection values     


I suspect the problem is from the $fieldset->addType - it is simply not rendering the block

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.