The grid widget
Instead of having to write our own grid blocks from scratch, we can reuse the ones that are already provided by the Magento
The block that we will be extending is called the 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 not only allows us to display our data in grid form, but also adds search, filtering, sorting, and mass action capabilities. Perform the following steps:
- Navigate to the block's
Adminhtml/folder and create a folder named
- Create a class called
List.phpinside that folder.
- Copy the following code inside