Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:03:50+00:00 2026-06-11T00:03:50+00:00

Can i use multiple grids in one magento module? <?php class <Namespace>_<Module>_Block_Adminhtml_<Module> extends Mage_Adminhtml_Block_Widget_Grid_Container

  • 0

Can i use multiple grids in one magento module?

<?php
class <Namespace>_<Module>_Block_Adminhtml_<Module> extends Mage_Adminhtml_Block_Widget_Grid_Container
{
  public function __construct()
  {
    $this->_controller = 'adminhtml_<module>';
    $this->_blockGroup = '<module>';
    $this->_headerText = Mage::helper('<module>')->__('Item Manager');
    $this->_addButtonLabel = Mage::helper('<module>')->__('Add Item');
    parent::__construct();
  }
}

so i can create one grid if i am bounded to use module, which means that grid is heavily dependent on module, so how can we use multiple grids in same module? I can’t find the way, plz guide me.

I am getting errors in my attempt to keep it move on. I am describing it more

My Grid Container

class World_Exporter_Block_Adminhtml_Import extends Mage_Adminhtml_Block_Widget_Grid_Container{
    public function __construct()
    {
                            // Correction made on getting answer
            $this->_controller = 'adminhtml_import';
            $this->_blockGroup = 'exporter';
                            // Correction made on getting answer

            $this->_headerText = Mage::helper('exporter')->__('Item Manager');
            $this->_addButtonLabel = Mage::helper('exporter')->__('Add Item');


    }
}

And My Grid

class World_Exporter_Block_Adminhtml_Import_Grid extends Mage_Adminhtml_Block_Widget_Grid{
    public function __construct(){
            parent::__construct();
            $this->setId('imports');
            $this->setSaveParametersInSession(false);

                 // As it was not calling prepareCollection() I explicitly call it
                          $this->_prepareCollection();

    }

    protected function _prepareCollection(){

            $collection = Mage::getModel('exporter/imports')->getCollection();
            $this->setCollection($collection);
            return parent::_prepareCollection();
    }

    protected function _prepareColumns(){
        //  return false;
            $this->addColumn('import_id ', array(
                    'header' => Mage::helper('exporter')->__('ID'),
                    'align' => 'right',
                    'width' => '50px',
                    'index' => 'import_id ',
            ));
            $this->addColumn('import_file', array(
                    'header' => Mage::helper('exporter')->__('File Name'),
                    'align' => 'left',
                    'index' => 'import_file',
            ));
            $this->addColumn('import_time', array(
                    'header' => Mage::helper('exporter')->__('Import Time'),
                    'align' => 'left',

                    'index' => 'import_time',

            ));

            $this->addColumn('profile_id', array(
                    'header' => Mage::helper('exporter')->__('Profile'),
                    'align' => 'left',

                    'index' => 'profile_id',

            ));
            return parent::_prepareColumns();
    }

    protected function _prepareMassaction(){
            $this->setMassactionIdField('import_id');
            $this->getMassactionBlock()->setFormFieldName('imports');
            return $this;
    }

}

My Controller

class World_Exporter_Adminhtml_ExporterController extends Mage_Adminhtml_Controller_action{
    public function importAction(){
            $this->_initAction();
            $this->_addContent($this->getLayout()->createBlock('exporter/adminhtml_import'));
            $this->renderLayout();  

    }
}   

My confix xml chunk

<models>
    <exporter>
        <class>World_Exporter_Model</class>

        <resourceModel>exporter_mysql4</resourceModel>
    </exporter>   
       <exporter_mysql4>
                <class>World_Exporter_Model_Mysql4</class>
                <!-- declate table test -->
                <entities>
                    <profiles>
                        <table>profiles</table>
                    </profiles>
                    <imports>
                        <table>imports</table>
                    </imports>
                    <columns>
                        <table>columns</table>
                    </columns>
                </entities>
                <!-- -/- -->
            </exporter_mysql4>
  </models>

My model

   class World_Exporter_Model_Imports extends Mage_Core_Model_Abstract
   {
       public function _construct()
       {

           $this->_init('exporter/imports');
       }
   }

Mysql4 Model

  class World_Exporter_Model_Mysql4_Imports extends Mage_Core_Model_Mysql4_Abstract
  {
     public function _construct()
     {

    $this->_init('exporter/imports', 'import_id');
     }
  }

My collection

  class World_Exporter_Model_Mysql4_Imports_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
  {
        public function _construct(){
                parent::_construct();
                $this->_init('exporter/imports');
        }
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:03:52+00:00Added an answer on June 11, 2026 at 12:03 am

    See your grid container:

    class World_Exporter_Block_Adminhtml_Import extends Mage_Adminhtml_Block_Widget_Grid_Container{
        public function __construct()
        {
            //should be $this->_controller = 'adminhtml_import';
            $this->_controller = 'adminhtml_exporter';
            //should be $this->_blockGroup = 'exporter';
            $this->_blockGroup = 'import';
            $this->_headerText = Mage::helper('exporter')->__('Item Manager');
            $this->_addButtonLabel = Mage::helper('exporter')->__('Add Item');
            parent::__construct();
        }
    }
    

    $this->_controller = 'adminhtml_exporter'; should be $this->_controller = 'adminhtml_import';

    $this->_blockGroup = 'import'; should be $this->_blockGroup = 'exporter';

    Why? From the name it is a bit ambiguous, yes it is named controller but you should take a look what is behind it.

    Mage_Adminhtml_Block_Widget_Grid_Container
    
    protected function _prepareLayout()
    {
        $this->setChild( 'grid',
            $this->getLayout()->createBlock( $this->_blockGroup.'/' . $this->_controller . '_grid',
            $this->_controller . '.grid')->setSaveParametersInSession(true) );
        return parent::_prepareLayout();
    }
    

    Your container will create a child (the child is a grid):

    $this->getLayout()->createBlock( $this->_blockGroup.'/' . $this->_controller . '_grid',
    $this->_controller . '.grid')

    Your previous code will create:

    $this->getLayout()->createBlock( 'import/adminhtml_exporter_grid',
    'adminhtml_exporter.grid')

    which is not correct, it should be:

    $this->getLayout()->createBlock( 'exporter/adminhtml_import_grid',
    'adminhtml_exporter.grid')

    because your grid is World_Exporter_Block_Adminhtml_Import_Grid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you use Git without Sudo in multiple accounts in one Ubuntu? My
can cassandra use multiple native secondary indexes when querying on mutiple indexed columns? using
I have been attempting to have a object that I can use across multiple
What is a library I can use for CSS webkit support across multiple browsers
In SQL Server 2008, you can use the Row Constructor syntax to insert multiple
how can I use the same UI template (*.ui.xml file) with multiple Java objects
I would like to know how can I use jQuery to select multiple items
I need to pass multiple rows to a stored procedure. Can I use a
I'd like to use C# to implement an application that can play multiple audio
How can I use the counter value to multiply the frogs in the array?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.