Definition at line 34 of file Grid.php.
__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 }
_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] |
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag_Customer, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag, Mage_Adminhtml_Block_Checkout_Agreement_Grid, Mage_Adminhtml_Block_Cms_Block_Grid, Mage_Adminhtml_Block_Cms_Page_Grid, Mage_Adminhtml_Block_Customer_Edit_Tab_Tag, Mage_Adminhtml_Block_Report_Product_Grid, Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid, Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid, Mage_Adminhtml_Block_Tag_Customer_Grid, and Mage_Adminhtml_Block_Tag_Product_Grid.
Definition at line 468 of file Grid.php.
_beforeToHtml | ( | ) | [protected] |
Before rendering html, but after trying to load cache
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
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.
_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
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] |
Prepare grid massaction actions
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Grid, Mage_Adminhtml_Block_Catalog_Search_Grid, Mage_Adminhtml_Block_Customer_Grid, Mage_Adminhtml_Block_Extensions_Local_Grid, Mage_Adminhtml_Block_Extensions_Remote_Grid, Mage_Adminhtml_Block_Newsletter_Subscriber_Grid, Mage_Adminhtml_Block_Notification_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_Grid, Mage_Adminhtml_Block_Sales_Shipment_Grid, Mage_Adminhtml_Block_Tag_Grid_Pending, Mage_Adminhtml_Block_Tag_Tag_Grid, Mage_Adminhtml_Block_Urlrewrite_Product_Grid, Mage_GoogleBase_Block_Adminhtml_Items_Item, and Mage_GoogleBase_Block_Adminhtml_Items_Product.
Definition at line 416 of file Grid.php.
_prepareMassactionBlock | ( | ) | [protected] |
Prepare grid massaction block
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
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
string | $columnId | |
array | || Varien_Object $column |
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
string | $url | |
string | $label |
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
string | $url | |
string | $label |
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 | ( | ) |
getColumn | ( | $ | columnId | ) |
Retrieve grid column by column id
string | $columnId |
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 | ( | ) |
getColumns | ( | ) |
getCountTotals | ( | ) |
Return count totals
Reimplemented in Mage_Adminhtml_Block_Report_Grid.
Definition at line 997 of file Grid.php.
getCsv | ( | ) |
Retrieve grid as CSV
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
Reimplemented in Mage_Adminhtml_Block_Report_Grid.
Definition at line 955 of file Grid.php.
getEmptyTextClass | ( | ) |
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 | ( | ) |
getFilterVisibility | ( | ) |
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
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.
getHtml | ( | ) |
getJsObjectName | ( | ) |
getLastColumnId | ( | ) |
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 | ( | ) |
getMassactionBlockHtml | ( | ) |
Definition at line 933 of file Grid.php.
00934 { 00935 return $this->getChildHtml('massaction'); 00936 }
getMassactionBlockName | ( | ) |
getMassactionIdField | ( | ) |
getMessageBlockVisibility | ( | ) |
getPagerVisibility | ( | ) |
getParam | ( | $ | paramName, | |
$ | default = null | |||
) |
Retrieve grid
string | $paramName | |
mixed | $default |
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
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 | ( | ) |
getSearchButtonHtml | ( | ) |
Definition at line 215 of file Grid.php.
00216 { 00217 return $this->getChildHtml('search_button'); 00218 }
getTotals | ( | ) |
getVarNameDir | ( | ) |
getVarNameFilter | ( | ) |
getVarNameLimit | ( | ) |
getVarNamePage | ( | ) |
getVarNameSort | ( | ) |
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
Varien_Data_Collection | $collection |
Definition at line 236 of file Grid.php.
setCountTotals | ( | $ | count = true |
) |
setDefaultDir | ( | $ | dir | ) |
setDefaultFilter | ( | $ | filter | ) |
setDefaultLimit | ( | $ | limit | ) |
setDefaultPage | ( | $ | page | ) |
setDefaultSort | ( | $ | sort | ) |
setEmptyText | ( | $ | text | ) |
Set empty text for grid
string | $text |
Definition at line 944 of file Grid.php.
setEmptyTextClass | ( | $ | cssClass | ) |
Set empty text CSS class
string | $text |
Definition at line 966 of file Grid.php.
setFilterVisibility | ( | $ | visible = true |
) |
setHeadersVisibility | ( | $ | visible = true |
) |
setMassactionBlockName | ( | $ | blockName | ) |
Set massaction block name
string | $blockName |
Definition at line 917 of file Grid.php.
setMassactionIdField | ( | $ | idField | ) |
Set massaction row identifier field
string | $idField |
Definition at line 895 of file Grid.php.
setMessageBlockVisibility | ( | $ | visible = true |
) |
setPagerVisibility | ( | $ | visible = true |
) |
setSaveParametersInSession | ( | $ | flag | ) |
setTotals | ( | Varien_Object $ | totals | ) |
setVarNameDir | ( | $ | name | ) |
setVarNameFilter | ( | $ | name | ) |
setVarNameLimit | ( | $ | name | ) |
setVarNamePage | ( | $ | name | ) |
setVarNameSort | ( | $ | name | ) |
$_collection = null [protected] |
Reimplemented in Mage_Adminhtml_Block_Dashboard_Searches_Last, and Mage_Adminhtml_Block_Dashboard_Searches_Top.
$_defaultLimit = 20 [protected] |
Reimplemented in Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Grid.
$_massactionBlockName = 'adminhtml/widget_grid_massaction' [protected] |