Instead of having to write our own grid blocks from scratch, we can reuse the ones that have been already provided by the Magento Adminhtml
module.
The block that we will be extending is called grid widget; the grid widget is a special type of block designed to render a collection of Magento objects in a particular table grid.
A grid widget is normally rendered inside a Grid container; the combination of both elements allow not only to display our data in a grid form but also adds search, filtering, sorting, and mass action capabilities. Perform the following steps:
Navigate to the block
Adminhtml/
folder and create a folder calledGiftregistry/
at the locationapp/code/loca/Mdg/Giftregistry/Block/Adminhtml/Customer/Edit/Tab/
.Create a class called
List.php
inside that folder.Copy the following code into the
Giftregistry/List.php
file:<?php class Mdg_Giftregistry_Block_Adminhtml_Customer_Edit_Tab_Giftregistry_List extends Mage_Adminhtml_Block_Widget_Grid { public function...