Mage_Adminhtml_Block_Widget_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid:

Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Adminhtml_Block_Api_Grid_Role Mage_Adminhtml_Block_Api_Role_Grid_User Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles Mage_Adminhtml_Block_Api_User_Grid Mage_Adminhtml_Block_Backup_Grid Mage_Adminhtml_Block_Catalog_Category_Tab_Product Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Grid Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag_Customer Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell Mage_Adminhtml_Block_Catalog_Product_Grid Mage_Adminhtml_Block_Catalog_Search_Grid Mage_Adminhtml_Block_Checkout_Agreement_Grid Mage_Adminhtml_Block_Cms_Block_Grid Mage_Adminhtml_Block_Cms_Page_Grid Mage_Adminhtml_Block_Customer_Edit_Tab_Cart Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid Mage_Adminhtml_Block_Customer_Edit_Tab_Orders Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews Mage_Adminhtml_Block_Customer_Edit_Tab_Tag Mage_Adminhtml_Block_Customer_Edit_Tab_Tags Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist Mage_Adminhtml_Block_Customer_Grid Mage_Adminhtml_Block_Customer_Group_Grid Mage_Adminhtml_Block_Customer_Online_Grid Mage_Adminhtml_Block_Dashboard_Grid Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Grid Mage_Adminhtml_Block_Extensions_Local_Grid Mage_Adminhtml_Block_Extensions_Remote_Grid Mage_Adminhtml_Block_Newsletter_Problem_Grid Mage_Adminhtml_Block_Newsletter_Queue_Grid Mage_Adminhtml_Block_Newsletter_Subscriber_Grid Mage_Adminhtml_Block_Newsletter_Template_Grid Mage_Adminhtml_Block_Notification_Grid Mage_Adminhtml_Block_Permissions_Grid_Role Mage_Adminhtml_Block_Permissions_Grid_User Mage_Adminhtml_Block_Permissions_Role_Grid_User Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Roles Mage_Adminhtml_Block_Permissions_User_Grid Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid Mage_Adminhtml_Block_Poll_Grid Mage_Adminhtml_Block_Promo_Catalog_Grid Mage_Adminhtml_Block_Promo_Quote_Grid Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku Mage_Adminhtml_Block_Rating_Grid Mage_Adminhtml_Block_Report_Grid Mage_Adminhtml_Block_Report_Product_Downloads_Grid Mage_Adminhtml_Block_Report_Product_Grid Mage_Adminhtml_Block_Report_Product_Lowstock_Grid Mage_Adminhtml_Block_Report_Review_Customer_Grid Mage_Adminhtml_Block_Report_Review_Detail_Grid Mage_Adminhtml_Block_Report_Review_Product_Grid Mage_Adminhtml_Block_Report_Search_Grid Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid Mage_Adminhtml_Block_Report_Shopcart_Product_Grid Mage_Adminhtml_Block_Report_Tag_Customer_Detail_Grid Mage_Adminhtml_Block_Report_Tag_Customer_Grid Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid Mage_Adminhtml_Block_Report_Tag_Popular_Grid Mage_Adminhtml_Block_Report_Tag_Product_Detail_Grid Mage_Adminhtml_Block_Report_Tag_Product_Grid Mage_Adminhtml_Block_Report_Wishlist_Grid Mage_Adminhtml_Block_Review_Grid Mage_Adminhtml_Block_Sales_Creditmemo_Grid Mage_Adminhtml_Block_Sales_Invoice_Grid Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid Mage_Adminhtml_Block_Sales_Order_Grid Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments Mage_Adminhtml_Block_Sales_Shipment_Grid Mage_Adminhtml_Block_Sitemap_Grid Mage_Adminhtml_Block_System_Convert_Gui_Grid Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_History Mage_Adminhtml_Block_System_Convert_Profile_Grid Mage_Adminhtml_Block_System_Design_Grid Mage_Adminhtml_Block_System_Email_Template_Grid Mage_Adminhtml_Block_System_Store_Grid Mage_Adminhtml_Block_Tag_Customer_Grid Mage_Adminhtml_Block_Tag_Grid_All Mage_Adminhtml_Block_Tag_Grid_Customers Mage_Adminhtml_Block_Tag_Grid_Pending Mage_Adminhtml_Block_Tag_Grid_Products Mage_Adminhtml_Block_Tag_Product_Grid Mage_Adminhtml_Block_Tag_Tag_Grid Mage_Adminhtml_Block_Tax_Class_Grid Mage_Adminhtml_Block_Tax_Rate_Grid Mage_Adminhtml_Block_Tax_Rule_Grid Mage_Adminhtml_Block_Urlrewrite_Grid Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid Mage_GoogleBase_Block_Adminhtml_Items_Item Mage_GoogleBase_Block_Adminhtml_Items_Product Mage_GoogleBase_Block_Adminhtml_Types_Grid

List of all members.

Public Member Functions

 __construct ($attributes=array())
 getExportButtonHtml ()
 getResetFilterButtonHtml ()
 getSearchButtonHtml ()
 getMainButtonsHtml ()
 setCollection ($collection)
 getCollection ()
 addColumn ($columnId, $column)
 getLastColumnId ()
 getColumnCount ()
 getColumn ($columnId)
 getColumns ()
 getVarNameLimit ()
 getVarNamePage ()
 getVarNameSort ()
 getVarNameDir ()
 getVarNameFilter ()
 setVarNameLimit ($name)
 setVarNamePage ($name)
 setVarNameSort ($name)
 setVarNameDir ($name)
 setVarNameFilter ($name)
 setHeadersVisibility ($visible=true)
 getHeadersVisibility ()
 setPagerVisibility ($visible=true)
 getPagerVisibility ()
 setFilterVisibility ($visible=true)
 getFilterVisibility ()
 setMessageBlockVisibility ($visible=true)
 getMessageBlockVisibility ()
 setDefaultLimit ($limit)
 setDefaultPage ($page)
 setDefaultSort ($sort)
 setDefaultDir ($dir)
 setDefaultFilter ($filter)
 getExportTypes ()
 addExportType ($url, $label)
 getRssLists ()
 addRssList ($url, $label)
 getHtml ()
 getCsv ()
 getXml ()
 getExcel ($filename= '')
 canDisplayContainer ()
 getGridUrl ()
 getParam ($paramName, $default=null)
 setSaveParametersInSession ($flag)
 getJsObjectName ()
 getRowId ($row)
 getMassactionIdField ()
 setMassactionIdField ($idField)
 getMassactionBlockName ()
 setMassactionBlockName ($blockName)
 getMassactionBlock ()
 getMassactionBlockHtml ()
 setEmptyText ($text)
 getEmptyText ()
 setEmptyTextClass ($cssClass)
 getEmptyTextClass ()
 setCountTotals ($count=true)
 getCountTotals ()
 setTotals (Varien_Object $totals)
 getTotals ()

Protected Member Functions

 _prepareLayout ()
 _setFilterValues ($data)
 _addColumnFilterToCollection ($column)
 _prepareCollection ()
 _preparePage ()
 _prepareColumns ()
 _prepareMassactionBlock ()
 _prepareMassaction ()
 _prepareMassactionColumn ()
 _prepareGrid ()
 _beforeToHtml ()
 _afterLoadCollection ()

Protected Attributes

 $_columns = array()
 $_lastColumnId
 $_collection = null
 $_varNameLimit = 'limit'
 $_varNamePage = 'page'
 $_varNameSort = 'sort'
 $_varNameDir = 'dir'
 $_varNameFilter = 'filter'
 $_defaultLimit = 20
 $_defaultPage = 1
 $_defaultSort = false
 $_defaultDir = 'desc'
 $_defaultFilter = array()
 $_isExport = false
 $_emptyText
 $_emptyTextCss = 'a-center'
 $_pagerVisibility = true
 $_headersVisibility = true
 $_filterVisibility = true
 $_messageBlockVisibility = false
 $_saveParametersInSession = false
 $_countTotals = false
 $_varTotals
 $_exportTypes = array()
 $_massactionIdField = null
 $_massactionBlockName = 'adminhtml/widget_grid_massaction'
 $_rssLists = array()


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct ( attributes = array()  ) 

Reimplemented in Mage_Adminhtml_Block_Customer_Edit_Tab_Cart, and Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku.

Definition at line 169 of file Grid.php.

00170     {
00171         parent::__construct($attributes);
00172         $this->setTemplate('widget/grid.phtml');
00173         $this->setRowClickCallback('openGridRow');
00174         $this->_emptyText = Mage::helper('adminhtml')->__('No records found.');
00175     }


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented in Mage_Adminhtml_Block_Api_Role_Grid_User, Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Catalog_Category_Tab_Product, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell, Mage_Adminhtml_Block_Catalog_Product_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist, Mage_Adminhtml_Block_Permissions_Role_Grid_User, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku, Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid, Mage_Adminhtml_Block_Tag_Grid_All, Mage_Adminhtml_Block_Tag_Grid_Customers, Mage_Adminhtml_Block_Tag_Grid_Pending, Mage_Adminhtml_Block_Tag_Product_Grid, Mage_Adminhtml_Block_Tag_Tag_Grid, and Mage_Adminhtml_Block_Tax_Rule_Grid.

Definition at line 322 of file Grid.php.

00323     {
00324         if ($this->getCollection()) {
00325             $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
00326             if ($column->getFilterConditionCallback()) {
00327                 call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
00328             } else {
00329                 $cond = $column->getFilter()->getCondition();
00330                 if ($field && isset($cond)) {
00331                     $this->getCollection()->addFieldToFilter($field , $cond);
00332                 }
00333             }
00334         }
00335         return $this;
00336     }

_afterLoadCollection (  )  [protected]

_beforeToHtml (  )  [protected]

Before rendering html, but after trying to load cache

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Reimplemented in Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid, and Mage_GoogleBase_Block_Adminhtml_Items_Product.

Definition at line 462 of file Grid.php.

00463     {
00464         $this->_prepareGrid();
00465         return parent::_beforeToHtml();
00466     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented in Mage_Adminhtml_Block_Api_Grid_Role, Mage_Adminhtml_Block_Api_Role_Grid_User, Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Api_User_Grid, Mage_Adminhtml_Block_Backup_Grid, Mage_Adminhtml_Block_Catalog_Category_Tab_Product, Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag_Customer, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell, Mage_Adminhtml_Block_Catalog_Product_Grid, Mage_Adminhtml_Block_Catalog_Search_Grid, Mage_Adminhtml_Block_Checkout_Agreement_Grid, Mage_Adminhtml_Block_Cms_Block_Grid, Mage_Adminhtml_Block_Cms_Page_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Orders, Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews, Mage_Adminhtml_Block_Customer_Edit_Tab_Tag, Mage_Adminhtml_Block_Customer_Edit_Tab_Tags, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist, Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist, Mage_Adminhtml_Block_Customer_Grid, Mage_Adminhtml_Block_Customer_Group_Grid, Mage_Adminhtml_Block_Customer_Online_Grid, Mage_Adminhtml_Block_Dashboard_Orders_Grid, Mage_Adminhtml_Block_Dashboard_Searches_Last, Mage_Adminhtml_Block_Dashboard_Searches_Top, Mage_Adminhtml_Block_Dashboard_Tab_Customers_Most, Mage_Adminhtml_Block_Dashboard_Tab_Customers_Newest, Mage_Adminhtml_Block_Dashboard_Tab_Products_Ordered, Mage_Adminhtml_Block_Dashboard_Tab_Products_Viewed, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Grid, Mage_Adminhtml_Block_Extensions_Local_Grid, Mage_Adminhtml_Block_Extensions_Remote_Grid, Mage_Adminhtml_Block_Newsletter_Problem_Grid, Mage_Adminhtml_Block_Newsletter_Queue_Grid, Mage_Adminhtml_Block_Newsletter_Subscriber_Grid, Mage_Adminhtml_Block_Newsletter_Template_Grid, Mage_Adminhtml_Block_Notification_Grid, Mage_Adminhtml_Block_Permissions_Grid_Role, Mage_Adminhtml_Block_Permissions_Grid_User, Mage_Adminhtml_Block_Permissions_Role_Grid_User, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Permissions_User_Grid, Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid, Mage_Adminhtml_Block_Poll_Grid, Mage_Adminhtml_Block_Promo_Catalog_Grid, Mage_Adminhtml_Block_Promo_Quote_Grid, Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku, Mage_Adminhtml_Block_Rating_Grid, Mage_Adminhtml_Block_Report_Customer_Accounts_Grid, Mage_Adminhtml_Block_Report_Customer_Orders_Grid, Mage_Adminhtml_Block_Report_Customer_Totals_Grid, Mage_Adminhtml_Block_Report_Grid, Mage_Adminhtml_Block_Report_Product_Downloads_Grid, Mage_Adminhtml_Block_Report_Product_Grid, Mage_Adminhtml_Block_Report_Product_Lowstock_Grid, Mage_Adminhtml_Block_Report_Product_Ordered_Grid, Mage_Adminhtml_Block_Report_Product_Sold_Grid, Mage_Adminhtml_Block_Report_Product_Viewed_Grid, Mage_Adminhtml_Block_Report_Review_Customer_Grid, Mage_Adminhtml_Block_Report_Review_Detail_Grid, Mage_Adminhtml_Block_Report_Review_Product_Grid, Mage_Adminhtml_Block_Report_Sales_Coupons_Grid, Mage_Adminhtml_Block_Report_Sales_Invoiced_Grid, Mage_Adminhtml_Block_Report_Sales_Refunded_Grid, Mage_Adminhtml_Block_Report_Sales_Sales_Grid, Mage_Adminhtml_Block_Report_Sales_Shipping_Grid, Mage_Adminhtml_Block_Report_Sales_Tax_Grid, Mage_Adminhtml_Block_Report_Search_Grid, Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid, Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid, Mage_Adminhtml_Block_Report_Shopcart_Product_Grid, Mage_Adminhtml_Block_Report_Tag_Customer_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Customer_Grid, Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Popular_Grid, Mage_Adminhtml_Block_Report_Tag_Product_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Product_Grid, Mage_Adminhtml_Block_Report_Wishlist_Grid, Mage_Adminhtml_Block_Review_Grid, Mage_Adminhtml_Block_Sales_Creditmemo_Grid, Mage_Adminhtml_Block_Sales_Invoice_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid, Mage_Adminhtml_Block_Sales_Order_Grid, Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos, Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices, Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments, Mage_Adminhtml_Block_Sales_Shipment_Grid, Mage_Adminhtml_Block_Sitemap_Grid, Mage_Adminhtml_Block_System_Convert_Gui_Grid, Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_History, Mage_Adminhtml_Block_System_Convert_Profile_Grid, Mage_Adminhtml_Block_System_Design_Grid, Mage_Adminhtml_Block_System_Email_Template_Grid, Mage_Adminhtml_Block_System_Store_Grid, Mage_Adminhtml_Block_Tag_Customer_Grid, Mage_Adminhtml_Block_Tag_Grid_All, Mage_Adminhtml_Block_Tag_Grid_Customers, Mage_Adminhtml_Block_Tag_Grid_Pending, Mage_Adminhtml_Block_Tag_Grid_Products, Mage_Adminhtml_Block_Tag_Product_Grid, Mage_Adminhtml_Block_Tag_Tag_Grid, Mage_Adminhtml_Block_Tax_Class_Grid, Mage_Adminhtml_Block_Tax_Rate_Grid, Mage_Adminhtml_Block_Tax_Rule_Grid, Mage_Adminhtml_Block_Urlrewrite_Grid, Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid, Mage_GoogleBase_Block_Adminhtml_Items_Item, Mage_GoogleBase_Block_Adminhtml_Items_Product, and Mage_GoogleBase_Block_Adminhtml_Types_Grid.

Definition at line 343 of file Grid.php.

00344     {
00345         if ($this->getCollection()) {
00346 
00347             $this->_preparePage();
00348 
00349             $columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort);
00350             $dir      = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
00351             $filter   = $this->getParam($this->getVarNameFilter(), null);
00352 
00353             if (is_null($filter)) {
00354                 $filter = $this->_defaultFilter;
00355             }
00356 
00357             if (is_string($filter)) {
00358                 $data = array();
00359                 $filter = base64_decode($filter);
00360                 parse_str(urldecode($filter), $data);
00361                 $this->_setFilterValues($data);
00362             } else if ($filter && is_array($filter)) {
00363                 $this->_setFilterValues($filter);
00364             } else if(0 !== sizeof($this->_defaultFilter)) {
00365                 $this->_setFilterValues($this->_defaultFilter);
00366             }
00367 
00368             if (isset($this->_columns[$columnId]) && $this->_columns[$columnId]->getIndex()) {
00369                 $dir = (strtolower($dir)=='desc') ? 'desc' : 'asc';
00370                 $this->_columns[$columnId]->setDir($dir);
00371                 $column = $this->_columns[$columnId]->getFilterIndex() ?
00372                     $this->_columns[$columnId]->getFilterIndex() : $this->_columns[$columnId]->getIndex();
00373                 $this->getCollection()->setOrder($column , $dir);
00374             }
00375 
00376             if ( !$this->_isExport )    {
00377                 $this->getCollection()->load();
00378                 $this->_afterLoadCollection();
00379             }
00380         }
00381 
00382         return $this;
00383     }

_prepareColumns (  )  [protected]

Reimplemented in Mage_Adminhtml_Block_Api_Grid_Role, Mage_Adminhtml_Block_Api_Role_Grid_User, Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Api_User_Grid, Mage_Adminhtml_Block_Backup_Grid, Mage_Adminhtml_Block_Catalog_Category_Tab_Product, Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag_Customer, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell, Mage_Adminhtml_Block_Catalog_Product_Grid, Mage_Adminhtml_Block_Catalog_Search_Grid, Mage_Adminhtml_Block_Checkout_Agreement_Grid, Mage_Adminhtml_Block_Cms_Block_Grid, Mage_Adminhtml_Block_Cms_Page_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Orders, Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews, Mage_Adminhtml_Block_Customer_Edit_Tab_Tag, Mage_Adminhtml_Block_Customer_Edit_Tab_Tags, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist, Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist, Mage_Adminhtml_Block_Customer_Grid, Mage_Adminhtml_Block_Customer_Group_Grid, Mage_Adminhtml_Block_Customer_Online_Grid, Mage_Adminhtml_Block_Dashboard_Orders_Grid, Mage_Adminhtml_Block_Dashboard_Searches_Last, Mage_Adminhtml_Block_Dashboard_Searches_Top, Mage_Adminhtml_Block_Dashboard_Tab_Customers_Most, Mage_Adminhtml_Block_Dashboard_Tab_Customers_Newest, Mage_Adminhtml_Block_Dashboard_Tab_Products_Ordered, Mage_Adminhtml_Block_Dashboard_Tab_Products_Viewed, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Grid, Mage_Adminhtml_Block_Extensions_Local_Grid, Mage_Adminhtml_Block_Extensions_Remote_Grid, Mage_Adminhtml_Block_Newsletter_Problem_Grid, Mage_Adminhtml_Block_Newsletter_Queue_Grid, Mage_Adminhtml_Block_Newsletter_Subscriber_Grid, Mage_Adminhtml_Block_Newsletter_Template_Grid, Mage_Adminhtml_Block_Notification_Grid, Mage_Adminhtml_Block_Permissions_Grid_Role, Mage_Adminhtml_Block_Permissions_Grid_User, Mage_Adminhtml_Block_Permissions_Role_Grid_User, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Permissions_User_Grid, Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid, Mage_Adminhtml_Block_Poll_Grid, Mage_Adminhtml_Block_Promo_Catalog_Grid, Mage_Adminhtml_Block_Promo_Quote_Grid, Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku, Mage_Adminhtml_Block_Rating_Grid, Mage_Adminhtml_Block_Report_Customer_Accounts_Grid, Mage_Adminhtml_Block_Report_Customer_Orders_Grid, Mage_Adminhtml_Block_Report_Customer_Totals_Grid, Mage_Adminhtml_Block_Report_Grid, Mage_Adminhtml_Block_Report_Product_Downloads_Grid, Mage_Adminhtml_Block_Report_Product_Grid, Mage_Adminhtml_Block_Report_Product_Lowstock_Grid, Mage_Adminhtml_Block_Report_Product_Ordered_Grid, Mage_Adminhtml_Block_Report_Product_Sold_Grid, Mage_Adminhtml_Block_Report_Product_Viewed_Grid, Mage_Adminhtml_Block_Report_Review_Customer_Grid, Mage_Adminhtml_Block_Report_Review_Detail_Grid, Mage_Adminhtml_Block_Report_Review_Product_Grid, Mage_Adminhtml_Block_Report_Sales_Coupons_Grid, Mage_Adminhtml_Block_Report_Sales_Invoiced_Grid, Mage_Adminhtml_Block_Report_Sales_Refunded_Grid, Mage_Adminhtml_Block_Report_Sales_Sales_Grid, Mage_Adminhtml_Block_Report_Sales_Shipping_Grid, Mage_Adminhtml_Block_Report_Sales_Tax_Grid, Mage_Adminhtml_Block_Report_Search_Grid, Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid, Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid, Mage_Adminhtml_Block_Report_Shopcart_Product_Grid, Mage_Adminhtml_Block_Report_Tag_Customer_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Customer_Grid, Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Popular_Grid, Mage_Adminhtml_Block_Report_Tag_Product_Detail_Grid, Mage_Adminhtml_Block_Report_Tag_Product_Grid, Mage_Adminhtml_Block_Report_Wishlist_Grid, Mage_Adminhtml_Block_Review_Grid, Mage_Adminhtml_Block_Review_Product_Grid, Mage_Adminhtml_Block_Sales_Creditmemo_Grid, Mage_Adminhtml_Block_Sales_Invoice_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid, Mage_Adminhtml_Block_Sales_Order_Grid, Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos, Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices, Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments, Mage_Adminhtml_Block_Sales_Shipment_Grid, Mage_Adminhtml_Block_Sitemap_Grid, Mage_Adminhtml_Block_System_Convert_Gui_Grid, Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_History, Mage_Adminhtml_Block_System_Convert_Profile_Grid, Mage_Adminhtml_Block_System_Design_Grid, Mage_Adminhtml_Block_System_Email_Template_Grid, Mage_Adminhtml_Block_System_Store_Grid, Mage_Adminhtml_Block_Tag_Customer_Grid, Mage_Adminhtml_Block_Tag_Grid_All, Mage_Adminhtml_Block_Tag_Grid_Customers, Mage_Adminhtml_Block_Tag_Grid_Pending, Mage_Adminhtml_Block_Tag_Grid_Products, Mage_Adminhtml_Block_Tag_Product_Grid, Mage_Adminhtml_Block_Tag_Tag_Grid, Mage_Adminhtml_Block_Tax_Class_Grid, Mage_Adminhtml_Block_Tax_Rate_Grid, Mage_Adminhtml_Block_Tax_Rule_Grid, Mage_Adminhtml_Block_Urlrewrite_Grid, Mage_Adminhtml_Block_Urlrewrite_Product_Grid, Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid, Mage_GoogleBase_Block_Adminhtml_Items_Item, Mage_GoogleBase_Block_Adminhtml_Items_Product, and Mage_GoogleBase_Block_Adminhtml_Types_Grid.

Definition at line 391 of file Grid.php.

00392     {
00393         return $this;
00394     }

_prepareGrid (  )  [protected]

Definition at line 454 of file Grid.php.

00455     {
00456         $this->_prepareColumns();
00457         $this->_prepareMassactionBlock();
00458         $this->_prepareCollection();
00459         return $this;
00460     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 177 of file Grid.php.

00178     {
00179         $this->setChild('export_button',
00180             $this->getLayout()->createBlock('adminhtml/widget_button')
00181                 ->setData(array(
00182                     'label'     => Mage::helper('adminhtml')->__('Export'),
00183                     'onclick'   => $this->getJsObjectName().'.doExport()',
00184                     'class'   => 'task'
00185                 ))
00186         );
00187         $this->setChild('reset_filter_button',
00188             $this->getLayout()->createBlock('adminhtml/widget_button')
00189                 ->setData(array(
00190                     'label'     => Mage::helper('adminhtml')->__('Reset Filter'),
00191                     'onclick'   => $this->getJsObjectName().'.resetFilter()',
00192                 ))
00193         );
00194         $this->setChild('search_button',
00195             $this->getLayout()->createBlock('adminhtml/widget_button')
00196                 ->setData(array(
00197                     'label'     => Mage::helper('adminhtml')->__('Search'),
00198                     'onclick'   => $this->getJsObjectName().'.doFilter()',
00199                     'class'   => 'task'
00200                 ))
00201         );
00202         return parent::_prepareLayout();
00203     }

_prepareMassaction (  )  [protected]

_prepareMassactionBlock (  )  [protected]

Prepare grid massaction block

Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 401 of file Grid.php.

00402     {
00403         $this->setChild('massaction', $this->getLayout()->createBlock($this->getMassactionBlockName()));
00404         $this->_prepareMassaction();
00405         if($this->getMassactionBlock()->isAvailable()) {
00406             $this->_prepareMassactionColumn();
00407         }
00408         return $this;
00409     }

_prepareMassactionColumn (  )  [protected]

Prepare grid massaction column

Returns:
unknown

Definition at line 427 of file Grid.php.

00428     {
00429         $columnId = 'massaction';
00430         $massactionColumn = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
00431                 ->setData(array(
00432                     'index'     => $this->getMassactionIdField(),
00433                     'type'      => 'massaction',
00434                     'name'      => $this->getMassactionBlock()->getFormFieldName(),
00435                     'align'     => 'center',
00436                     'is_system' => true
00437                 ));
00438 
00439         if ($this->getNoFilterMassactionColumn()) {
00440             $massactionColumn->setData('filter', false);
00441         }
00442 
00443         $massactionColumn->setSelected($this->getMassactionBlock()->getSelected())
00444             ->setGrid($this)
00445             ->setId($columnId);
00446 
00447         $oldColumns = $this->_columns;
00448         $this->_columns = array();
00449         $this->_columns[$columnId] = $massactionColumn;
00450         $this->_columns = array_merge($this->_columns, $oldColumns);
00451         return $this;
00452     }

_preparePage (  )  [protected]

Reimplemented in Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders.

Definition at line 385 of file Grid.php.

00386     {
00387         $this->getCollection()->setPageSize($this->getParam($this->getVarNameLimit(), $this->_defaultLimit));
00388         $this->getCollection()->setCurPage($this->getParam($this->getVarNamePage(), $this->_defaultPage));
00389     }

_setFilterValues ( data  )  [protected]

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 311 of file Grid.php.

00312     {
00313         foreach ($this->getColumns() as $columnId => $column) {
00314             if (isset($data[$columnId]) && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0) && $column->getFilter()) {
00315                 $column->getFilter()->setValue($data[$columnId]);
00316                 $this->_addColumnFilterToCollection($column);
00317             }
00318         }
00319         return $this;
00320     }

addColumn ( columnId,
column 
)

Add column to grid

Parameters:
string $columnId
array || Varien_Object $column
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 258 of file Grid.php.

00259     {
00260         if (is_array($column)) {
00261             $this->_columns[$columnId] = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
00262                 ->setData($column)
00263                 ->setGrid($this);
00264         }
00265         /*elseif ($column instanceof Varien_Object) {
00266             $this->_columns[$columnId] = $column;
00267         }*/
00268         else {
00269             throw new Exception(Mage::helper('adminhtml')->__('Wrong column format'));
00270         }
00271 
00272         $this->_columns[$columnId]->setId($columnId);
00273         $this->_lastColumnId = $columnId;
00274         return $this;
00275     }

addExportType ( url,
label 
)

Add new export type to grid

Parameters:
string $url
string $label
Returns:
Mage_Adminhtml_Block_Widget_Grid

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 650 of file Grid.php.

00651     {
00652         $this->_exportTypes[] = new Varien_Object(
00653             array(
00654                 'url'   => $this->getUrl($url, array('_current'=>true)),
00655                 'label' => $label
00656             )
00657         );
00658         return $this;
00659     }

addRssList ( url,
label 
)

Add new rss list to grid

Parameters:
string $url
string $label
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 678 of file Grid.php.

00679     {
00680         $this->_rssLists[] = new Varien_Object(
00681             array(
00682                 'url'   => Mage::getModel('core/url')->getUrl($url),
00683                 'label' => $label
00684             )
00685         );
00686         return $this;
00687     }

canDisplayContainer (  ) 

Definition at line 819 of file Grid.php.

00820     {
00821         if ($this->getRequest()->getQuery('ajax')) {
00822             return false;
00823         }
00824         return true;
00825     }

getCollection (  ) 

get collection object

Returns:
Varien_Data_Collection

Definition at line 246 of file Grid.php.

00247     {
00248         return $this->_collection;
00249     }

getColumn ( columnId  ) 

Retrieve grid column by column id

Parameters:
string $columnId
Returns:
Varien_Object || false

Definition at line 293 of file Grid.php.

00294     {
00295         if (!empty($this->_columns[$columnId])) {
00296             return $this->_columns[$columnId];
00297         }
00298         return false;
00299     }

getColumnCount (  ) 

Definition at line 282 of file Grid.php.

00283     {
00284         return count($this->getColumns());
00285     }

getColumns (  ) 

Retrieve all grid columns

Returns:
array

Definition at line 306 of file Grid.php.

00307     {
00308         return $this->_columns;
00309     }

getCountTotals (  ) 

Return count totals

Returns:
boolean

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 997 of file Grid.php.

00998     {
00999         return $this->_countTotals;
01000     }

getCsv (  ) 

Retrieve grid as CSV

Returns:
unknown

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 704 of file Grid.php.

00705     {
00706         $csv = '';
00707         $this->_isExport = true;
00708         $this->_prepareGrid();
00709         $this->getCollection()->getSelect()->limit();
00710         $this->getCollection()->setPageSize(0);
00711         $this->getCollection()->load();
00712         $this->_afterLoadCollection();
00713 
00714         $data = array();
00715         foreach ($this->_columns as $column) {
00716             if (!$column->getIsSystem()) {
00717                 $data[] = '"'.$column->getExportHeader().'"';
00718             }
00719         }
00720         $csv.= implode(',', $data)."\n";
00721 
00722         foreach ($this->getCollection() as $item) {
00723             $data = array();
00724             foreach ($this->_columns as $column) {
00725                 if (!$column->getIsSystem()) {
00726                     $data[] = '"'.str_replace(array('"', '\\'), array('""', '\\\\'), $column->getRowFieldExport($item)).'"';
00727                 }
00728             }
00729             $csv.= implode(',', $data)."\n";
00730         }
00731 
00732         if ($this->getCountTotals())
00733         {
00734             $data = array();
00735             foreach ($this->_columns as $column) {
00736                 if (!$column->getIsSystem()) {
00737                     $data[] = '"'.str_replace(array('"', '\\'), array('""', '\\\\'), $column->getRowFieldExport($this->getTotals())).'"';
00738                 }
00739             }
00740             $csv.= implode(',', $data)."\n";
00741         }
00742 
00743         return $csv;
00744     }

getEmptyText (  ) 

Return empty text for grid

Returns:
string

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 955 of file Grid.php.

00956     {
00957         return $this->_emptyText;
00958     }

getEmptyTextClass (  ) 

Return empty text CSS class

Returns:
string

Definition at line 977 of file Grid.php.

00978     {
00979         return $this->_emptyTextCss;
00980     }

getExcel ( filename = ''  ) 

Reimplemented in Mage_Adminhtml_Block_Report_Grid.

Definition at line 773 of file Grid.php.

00774     {
00775         $this->_isExport = true;
00776         $this->_prepareGrid();
00777         $this->getCollection()->getSelect()->limit();
00778         $this->getCollection()->setPageSize(0);
00779         $this->getCollection()->load();
00780         $this->_afterLoadCollection();
00781         $headers = array();
00782         $data = array();
00783         foreach ($this->_columns as $column) {
00784             if (!$column->getIsSystem()) {
00785                 $headers[] = $column->getHeader();
00786             }
00787         }
00788         $data[] = $headers;
00789 
00790         foreach ($this->getCollection() as $item) {
00791             $row = array();
00792             foreach ($this->_columns as $column) {
00793                 if (!$column->getIsSystem()) {
00794                     $row[] = $column->getRowField($item);
00795                 }
00796             }
00797             $data[] = $row;
00798         }
00799 
00800         if ($this->getCountTotals())
00801         {
00802             $row = array();
00803             foreach ($this->_columns as $column) {
00804                 if (!$column->getIsSystem()) {
00805                     $row[] = $column->getRowField($this->getTotals());
00806                 }
00807             }
00808             $data[] = $row;
00809         }
00810 
00811         $xmlObj = new Varien_Convert_Parser_Xml_Excel();
00812         $xmlObj->setVar('single_sheet', $filename);
00813         $xmlObj->setData($data);
00814         $xmlObj->unparse();
00815 
00816         return $xmlObj->getData();
00817     }

getExportButtonHtml (  ) 

Definition at line 205 of file Grid.php.

00206     {
00207         return $this->getChildHtml('export_button');
00208     }

getExportTypes (  ) 

Retrieve grid export types

Returns:
array

Definition at line 638 of file Grid.php.

00639     {
00640         return empty($this->_exportTypes) ? false : $this->_exportTypes;
00641     }

getFilterVisibility (  ) 

Return visibility of filter

Returns:
boolean

Definition at line 578 of file Grid.php.

00579     {
00580         return $this->_filterVisibility;
00581     }

getGridUrl (  ) 

Reimplemented in Mage_Adminhtml_Block_Api_Grid_Role, Mage_Adminhtml_Block_Api_Role_Grid_User, Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Api_User_Grid, Mage_Adminhtml_Block_Catalog_Category_Tab_Product, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag_Customer, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell, Mage_Adminhtml_Block_Catalog_Product_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Orders, Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews, Mage_Adminhtml_Block_Customer_Edit_Tab_Tag, Mage_Adminhtml_Block_Customer_Edit_Tab_Tags, Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist, Mage_Adminhtml_Block_Customer_Grid, Mage_Adminhtml_Block_Extensions_Local_Grid, Mage_Adminhtml_Block_Extensions_Remote_Grid, Mage_Adminhtml_Block_Permissions_Grid_Role, Mage_Adminhtml_Block_Permissions_Role_Grid_User, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Roles, Mage_Adminhtml_Block_Permissions_User_Grid, Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid, Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku, Mage_Adminhtml_Block_Review_Grid, Mage_Adminhtml_Block_Review_Product_Grid, Mage_Adminhtml_Block_Sales_Creditmemo_Grid, Mage_Adminhtml_Block_Sales_Invoice_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid, Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid, Mage_Adminhtml_Block_Sales_Order_Grid, Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos, Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices, Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments, Mage_Adminhtml_Block_Sales_Shipment_Grid, Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_History, Mage_Adminhtml_Block_System_Design_Grid, Mage_Adminhtml_Block_Urlrewrite_Product_Grid, Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid, Mage_GoogleBase_Block_Adminhtml_Items_Item, Mage_GoogleBase_Block_Adminhtml_Items_Product, and Mage_GoogleBase_Block_Adminhtml_Types_Grid.

Definition at line 827 of file Grid.php.

00828     {
00829         return $this->getCurrentUrl();
00830     }

getHeadersVisibility (  ) 

Return visibility of column headers

Returns:
boolean

Reimplemented in Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart, Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders, and Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist.

Definition at line 538 of file Grid.php.

00539     {
00540         return $this->_headersVisibility;
00541     }

getHtml (  ) 

Retrieve grid HTML

Returns:
string

Definition at line 694 of file Grid.php.

00695     {
00696         return $this->toHtml();
00697     }

getJsObjectName (  ) 

Definition at line 864 of file Grid.php.

00865     {
00866         return $this->getId().'JsObject';
00867     }

getLastColumnId (  ) 

Definition at line 277 of file Grid.php.

00278     {
00279         return $this->_lastColumnId;
00280     }

getMainButtonsHtml (  ) 

Definition at line 220 of file Grid.php.

00221     {
00222         $html = '';
00223         if($this->getFilterVisibility()){
00224             $html.= $this->getResetFilterButtonHtml();
00225             $html.= $this->getSearchButtonHtml();
00226         }
00227         return $html;
00228     }

getMassactionBlock (  ) 

Retrive massaction block

Returns:
Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract

Definition at line 928 of file Grid.php.

00929     {
00930         return $this->getChild('massaction');
00931     }

getMassactionBlockHtml (  ) 

Definition at line 933 of file Grid.php.

00934     {
00935         return $this->getChildHtml('massaction');
00936     }

getMassactionBlockName (  ) 

Retrive massaction block name

Returns:
string

Definition at line 906 of file Grid.php.

00907     {
00908         return $this->_massactionBlockName;
00909     }

getMassactionIdField (  ) 

Retrive massaction row identifier field

Returns:
string

Definition at line 884 of file Grid.php.

00885     {
00886         return $this->_massactionIdField;
00887     }

getMessageBlockVisibility (  ) 

Return visibility of filter

Returns:
boolean

Definition at line 598 of file Grid.php.

00599     {
00600         return $this->_messageBlockVisibility;
00601     }

getPagerVisibility (  ) 

Return visibility of pager

Returns:
boolean

Definition at line 558 of file Grid.php.

00559     {
00560         return $this->_pagerVisibility;
00561     }

getParam ( paramName,
default = null 
)

Retrieve grid

Parameters:
string $paramName
mixed $default
Returns:
mixed

Definition at line 839 of file Grid.php.

00840     {
00841         $session = Mage::getSingleton('adminhtml/session');
00842         $sessionParamName = $this->getId().$paramName;
00843         if ($this->getRequest()->has($paramName)) {
00844             $param = $this->getRequest()->getParam($paramName);
00845             if ($this->_saveParametersInSession) {
00846                 $session->setData($sessionParamName, $param);
00847             }
00848             return $param;
00849         }
00850         elseif ($this->_saveParametersInSession && ($param = $session->getData($sessionParamName)))
00851         {
00852             return $param;
00853         }
00854 
00855         return $default;
00856     }

getResetFilterButtonHtml (  ) 

Definition at line 210 of file Grid.php.

00211     {
00212         return $this->getChildHtml('reset_filter_button');
00213     }

getRowId ( row  ) 

Deprecated since 1.1.7

Returns:
string

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid.

Definition at line 874 of file Grid.php.

00875     {
00876         return $this->getRowUrl($row);
00877     }

getRssLists (  ) 

Retrieve rss lists types

Returns:
array

Definition at line 666 of file Grid.php.

00667     {
00668         return empty($this->_rssLists) ? false : $this->_rssLists;
00669     }

getSearchButtonHtml (  ) 

Definition at line 215 of file Grid.php.

00216     {
00217         return $this->getChildHtml('search_button');
00218     }

getTotals (  ) 

Return count totals

Returns:
boolean

Definition at line 1017 of file Grid.php.

01018     {
01019         return $this->_varTotals;
01020     }

getVarNameDir (  ) 

Definition at line 488 of file Grid.php.

00489     {
00490         return $this->_varNameDir;
00491     }

getVarNameFilter (  ) 

Definition at line 493 of file Grid.php.

00494     {
00495         return $this->_varNameFilter;
00496     }

getVarNameLimit (  ) 

Definition at line 473 of file Grid.php.

00474     {
00475         return $this->_varNameLimit;
00476     }

getVarNamePage (  ) 

Definition at line 478 of file Grid.php.

00479     {
00480         return $this->_varNamePage;
00481     }

getVarNameSort (  ) 

Definition at line 483 of file Grid.php.

00484     {
00485         return $this->_varNameSort;
00486     }

getXml (  ) 

Definition at line 746 of file Grid.php.

00747     {
00748         $this->_isExport = true;
00749         $this->_prepareGrid();
00750         $this->getCollection()->getSelect()->limit();
00751         $this->getCollection()->setPageSize(0);
00752         $this->getCollection()->load();
00753         $this->_afterLoadCollection();
00754         $indexes = array();
00755         foreach ($this->_columns as $column) {
00756             if (!$column->getIsSystem()) {
00757                 $indexes[] = $column->getIndex();
00758             }
00759         }
00760         $xml = '<?xml version="1.0" encoding="UTF-8"?>';
00761         $xml.= '<items>';
00762         foreach ($this->getCollection() as $item) {
00763             $xml.= $item->toXml($indexes);
00764         }
00765         if ($this->getCountTotals())
00766         {
00767             $xml.= $this->getTotals()->toXml($indexes);
00768         }
00769         $xml.= '</items>';
00770         return $xml;
00771     }

setCollection ( collection  ) 

set collection object

Parameters:
Varien_Data_Collection $collection

Definition at line 236 of file Grid.php.

00237     {
00238         $this->_collection = $collection;
00239     }

setCountTotals ( count = true  ) 

Set count totals

Parameters:
boolean $visible

Definition at line 987 of file Grid.php.

00988     {
00989         $this->_countTotals = $count;
00990     }

setDefaultDir ( dir  ) 

Definition at line 621 of file Grid.php.

00622     {
00623         $this->_defaultDir = $dir;
00624         return $this;
00625     }

setDefaultFilter ( filter  ) 

Definition at line 627 of file Grid.php.

00628     {
00629         $this->_defaultFilter = $filter;
00630         return $this;
00631     }

setDefaultLimit ( limit  ) 

Definition at line 603 of file Grid.php.

00604     {
00605         $this->_defaultLimit = $limit;
00606         return $this;
00607     }

setDefaultPage ( page  ) 

Definition at line 609 of file Grid.php.

00610     {
00611         $this->_defaultPage = $page;
00612         return $this;
00613     }

setDefaultSort ( sort  ) 

Definition at line 615 of file Grid.php.

00616     {
00617         $this->_defaultSort = $sort;
00618         return $this;
00619     }

setEmptyText ( text  ) 

Set empty text for grid

Parameters:
string $text
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 944 of file Grid.php.

00945     {
00946         $this->_emptyText = $text;
00947         return $this;
00948     }

setEmptyTextClass ( cssClass  ) 

Set empty text CSS class

Parameters:
string $text
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 966 of file Grid.php.

00967     {
00968         $this->_emptyTextCss = $text;
00969         return $this;
00970     }

setFilterVisibility ( visible = true  ) 

Set visibility of filter

Parameters:
boolean $visible

Definition at line 568 of file Grid.php.

00569     {
00570         $this->_filterVisibility = $visible;
00571     }

setHeadersVisibility ( visible = true  ) 

Set visibility of column headers

Parameters:
boolean $visible

Definition at line 528 of file Grid.php.

00529     {
00530         $this->_headersVisibility = $visible;
00531     }

setMassactionBlockName ( blockName  ) 

Set massaction block name

Parameters:
string $blockName
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 917 of file Grid.php.

00918     {
00919         $this->_massactionBlockName = $blockName;
00920         return $this;
00921     }

setMassactionIdField ( idField  ) 

Set massaction row identifier field

Parameters:
string $idField
Returns:
Mage_Adminhtml_Block_Widget_Grid

Definition at line 895 of file Grid.php.

00896     {
00897         $this->_massactionIdField = $idField;
00898         return $this;
00899     }

setMessageBlockVisibility ( visible = true  ) 

Set visibility of filter

Parameters:
boolean $visible

Definition at line 588 of file Grid.php.

00589     {
00590         $this->_messageBlockVisibility = $visible;
00591     }

setPagerVisibility ( visible = true  ) 

Set visibility of pager

Parameters:
boolean $visible

Definition at line 548 of file Grid.php.

00549     {
00550         $this->_pagerVisibility = $visible;
00551     }

setSaveParametersInSession ( flag  ) 

Definition at line 858 of file Grid.php.

00859     {
00860         $this->_saveParametersInSession = $flag;
00861         return $this;
00862     }

setTotals ( Varien_Object totals  ) 

Set totals

Parameters:
boolean $visible

Definition at line 1007 of file Grid.php.

01008     {
01009         $this->_varTotals = $totals;
01010     }

setVarNameDir ( name  ) 

Definition at line 513 of file Grid.php.

00514     {
00515         return $this->_varNameDir = $name;
00516     }

setVarNameFilter ( name  ) 

Definition at line 518 of file Grid.php.

00519     {
00520         return $this->_varNameFilter = $name;
00521     }

setVarNameLimit ( name  ) 

Definition at line 498 of file Grid.php.

00499     {
00500         return $this->_varNameLimit = $name;
00501     }

setVarNamePage ( name  ) 

Definition at line 503 of file Grid.php.

00504     {
00505         return $this->_varNamePage = $name;
00506     }

setVarNameSort ( name  ) 

Definition at line 508 of file Grid.php.

00509     {
00510         return $this->_varNameSort = $name;
00511     }


Member Data Documentation

$_collection = null [protected]

$_columns = array() [protected]

Definition at line 50 of file Grid.php.

$_countTotals = false [protected]

Definition at line 134 of file Grid.php.

$_defaultDir = 'desc' [protected]

Definition at line 75 of file Grid.php.

$_defaultFilter = array() [protected]

Definition at line 76 of file Grid.php.

$_defaultLimit = 20 [protected]

Reimplemented in Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Grid.

Definition at line 72 of file Grid.php.

$_defaultPage = 1 [protected]

Definition at line 73 of file Grid.php.

$_defaultSort = false [protected]

Definition at line 74 of file Grid.php.

$_emptyText [protected]

Definition at line 90 of file Grid.php.

$_emptyTextCss = 'a-center' [protected]

Definition at line 97 of file Grid.php.

$_exportTypes = array() [protected]

Definition at line 148 of file Grid.php.

$_filterVisibility = true [protected]

Definition at line 118 of file Grid.php.

$_headersVisibility = true [protected]

Definition at line 111 of file Grid.php.

$_isExport = false [protected]

Definition at line 83 of file Grid.php.

$_lastColumnId [protected]

Definition at line 52 of file Grid.php.

$_massactionBlockName = 'adminhtml/widget_grid_massaction' [protected]

Definition at line 162 of file Grid.php.

$_massactionIdField = null [protected]

Definition at line 155 of file Grid.php.

$_messageBlockVisibility = false [protected]

Definition at line 125 of file Grid.php.

$_pagerVisibility = true [protected]

Definition at line 104 of file Grid.php.

$_rssLists = array() [protected]

Definition at line 167 of file Grid.php.

$_saveParametersInSession = false [protected]

Definition at line 127 of file Grid.php.

$_varNameDir = 'dir' [protected]

Definition at line 69 of file Grid.php.

$_varNameFilter = 'filter' [protected]

Definition at line 70 of file Grid.php.

$_varNameLimit = 'limit' [protected]

Definition at line 66 of file Grid.php.

$_varNamePage = 'page' [protected]

Definition at line 67 of file Grid.php.

$_varNameSort = 'sort' [protected]

Definition at line 68 of file Grid.php.

$_varTotals [protected]

Definition at line 141 of file Grid.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:08 2009 for Magento by  doxygen 1.5.8