Thailand Magento Ecommerce Blog

Create a simple form and grid for a custom entity

Describe how to implement advanced Adminhtml Grids and Forms, including

editable cells, mass actions, totals, reports, custom filters and renderers, multiple

grids on one page, combining grids with forms, and adding custom JavaScript to an

admin form:

  • Which block class do Magento grid classes typically extend?
  • What is the default template for Magento grid instances?
  • How can grid filters be customized?
  • How does Magento actually perform sorting/paging/filtering operations?
  • What protected methods are specific to adminhtml grids, and how are they used?
  • What is the standard column class in a grid, and what is its role?
  • What are column renderers used for in Magento?
  • How can JavaScript that is used for a Magento grid be customized?
  • What is the role of the grid container class and its template?
  • What is the programmatic structure of mass actions?

These code references can be used as an entry point to find answers to the questions

above:

  • Mage_Adminhtml_Block_Widget_Grid
  • Mage_Adminhtml_Block_Widget_Grid_Column
  • Mage_Adminhtml_Block_Widget_Grid_Column_Renderer/*
  • Mage_Adminhtml_Block_Widget_Grid_Column_Filter/*
  • Mage_Adminhtml_Block_Widget_Grid_Container
  • app/design/adminhtml/default/default/template/widget/grid.phtml
  • app/design/adminhtml/default/default/template/widget/grid/container.phtml