Magento Grid Container Block not loading grid

Geoff picture Geoff · Apr 19, 2011 · Viewed 9k times · Source

I just set up an admin module with a grid view using the module creator, and it works great, but now I need to add another grid view within the same module.

I copied and renamed all the files relevant to the grid view(controllers and block files, but not models, as they are not needed for what I'm doing) , and added the newly created block to the layout xml under the handle for it's new controller.

Using Firephp, I've worked out that everything loads fine for my new view up until the Grid.php which doesn't load, and the end output is just a blank page.

As far as I'm aware, this new view is identical to the original working grid view generated by the module in all aspects except name, so what could be causing it to not recognize or load the Grid.php?

Answer

clockworkgeek picture clockworkgeek · Apr 19, 2011

In the grid container block look at the values for $_blockGroup and $_controller. These are used by the container to find and load the grid block. If you really want to see what is going on look at the parent::_prepareLayout() method.

PS:
$_blockGroup is your module's name.
$_controller is the path to your grid block.

PPS:
If that's not enough put this in your .htaccess:

php_flag display_errors on
SetEnv MAGE_IS_DEVELOPER_MODE true

You should get a lot more information if the grid is having problems with it's collection's SQL or something.