diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
index b7d83e50964..46cda7afe02 100644
--- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
@@ -78,7 +78,6 @@ protected function _prepareColumns()
'header' => Mage::helper('backup')->__('Time'),
'index' => 'date_object',
'type' => 'datetime',
- 'width' => 200
]);
$this->addColumn('display_name', [
diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php
index 6439768505a..3c7eb4c5140 100644
--- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php
+++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php
@@ -91,7 +91,6 @@ protected function _prepareColumns()
'header' => Mage::helper('customer')->__('Date Added'),
'index' => 'added_at',
'type' => 'date',
- 'width' => '140px',
]);
$this->addColumn('days', [
diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php
index 1d8f247ac6c..a908ec6de5b 100644
--- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php
@@ -111,7 +111,6 @@ protected function _prepareColumns()
$this->addColumn('session_start_time', [
'header' => Mage::helper('customer')->__('Session Start Time'),
'align' => 'left',
- 'width' => '200px',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'index' =>'first_visit_at'
@@ -120,7 +119,6 @@ protected function _prepareColumns()
$this->addColumn('last_activity', [
'header' => Mage::helper('customer')->__('Last Activity'),
'align' => 'left',
- 'width' => '200px',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'last_visit_at'
diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php
index 4692caa2a98..f1b4a2fdde4 100644
--- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php
@@ -66,7 +66,6 @@ protected function _prepareColumns()
$this->addColumn('date_added', [
'header' => Mage::helper('adminnotification')->__('Date Added'),
'index' => 'date_added',
- 'width' => '150px',
'type' => 'datetime'
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php
index 457aa6a5f68..f6ea5fff031 100644
--- a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php
@@ -85,7 +85,6 @@ protected function _prepareColumns()
$this->addColumn('date_posted', [
'header' => Mage::helper('poll')->__('Date Posted'),
'align' => 'left',
- 'width' => '120px',
'type' => 'datetime',
'index' => 'date_posted',
'format' => Mage::app()->getLocale()->getDateFormat()
@@ -94,7 +93,6 @@ protected function _prepareColumns()
$this->addColumn('date_closed', [
'header' => Mage::helper('poll')->__('Date Closed'),
'align' => 'left',
- 'width' => '120px',
'type' => 'datetime',
'default' => '--',
'index' => 'date_closed',
diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
index 44c307287e1..84ccd5b1d66 100644
--- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
@@ -81,7 +81,6 @@ protected function _prepareColumns()
$this->addColumn('from_date', [
'header' => Mage::helper('catalogrule')->__('Date Start'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'index' => 'from_date',
]);
@@ -89,7 +88,6 @@ protected function _prepareColumns()
$this->addColumn('to_date', [
'header' => Mage::helper('catalogrule')->__('Date Expire'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'default' => '--',
'index' => 'to_date',
diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php
index 05c378c8a46..6af2b1204af 100644
--- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php
@@ -72,7 +72,6 @@ protected function _prepareColumns()
'index' => 'created_at',
'type' => 'datetime',
'align' => 'center',
- 'width' => '160'
]);
$this->addColumn('used', [
diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php
index 4798ec045ab..8465da40a5f 100644
--- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php
@@ -89,7 +89,6 @@ protected function _prepareColumns()
$this->addColumn('from_date', [
'header' => Mage::helper('salesrule')->__('Date Start'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'index' => 'from_date',
]);
@@ -97,7 +96,6 @@ protected function _prepareColumns()
$this->addColumn('to_date', [
'header' => Mage::helper('salesrule')->__('Date Expire'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'default' => '--',
'index' => 'to_date',
diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php
index ebc5940cb4c..544d9516646 100644
--- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php
+++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php
@@ -137,7 +137,6 @@ protected function _prepareColumns()
$this->addColumn('from_date', [
'header' => Mage::helper('salesrule')->__('Date Start'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'index' => 'from_date',
]);
@@ -145,7 +144,6 @@ protected function _prepareColumns()
$this->addColumn('to_date', [
'header' => Mage::helper('salesrule')->__('Date Expire'),
'align' => 'left',
- 'width' => '120px',
'type' => 'date',
'default' => '--',
'index' => 'to_date',
diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php
index 63b6e0699cd..9d727d97ed7 100644
--- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php
@@ -132,7 +132,6 @@ protected function _prepareColumns()
'header' => Mage::helper('reports')->__('Updated At'),
'index' => 'updated_at',
'type' => 'datetime',
- 'width' => 200,
'default' => Mage::helper('reports')->__('undefined'),
'sortable' => false
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php
index a31192dda93..4a7156a806d 100644
--- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php
@@ -81,7 +81,6 @@ protected function _prepareColumns()
$this->addColumn('created_at', [
'header' =>Mage::helper('reports')->__('Submitted On'),
- 'width' => '140px',
'type' => 'datetime',
'index' => 'created_at'
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php
index 7dac93b6d4a..737ac6f1882 100644
--- a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php
@@ -81,7 +81,6 @@ protected function _prepareColumns()
'header' => Mage::helper('review')->__('Created On'),
'align' => 'left',
'type' => 'datetime',
- 'width' => '100px',
'filter_index' => 'rt.created_at',
'index' => 'review_created_at',
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
index 4dfc0573a1d..44f1327e26c 100644
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
@@ -80,7 +80,6 @@ protected function _prepareColumns()
'header' => Mage::helper('sales')->__('Purchased On'),
'index' => 'created_at',
'type' => 'datetime',
- 'width' => '150px',
]);
$this->addColumn('billing_name', [
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php
index 24444931120..df5c57358d0 100644
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php
@@ -120,7 +120,6 @@ protected function _prepareColumns()
$this->addColumn('created_at', [
'header' => Mage::helper('sales')->__('Created At'),
'index' => 'created_at',
- 'width' => 1,
'type' => 'datetime',
'align' => 'center',
'default' => $this->__('N/A'),
diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php
index aebc842c34f..12e478f3426 100644
--- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php
@@ -69,7 +69,6 @@ protected function _prepareColumns()
$this->addColumn('sitemap_time', [
'header' => Mage::helper('sitemap')->__('Last Time Generated'),
- 'width' => '150px',
'index' => 'sitemap_time',
'type' => 'datetime',
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php
index b66482420ae..bf72d7a0903 100644
--- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php
+++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php
@@ -68,7 +68,6 @@ protected function _prepareColumns()
'header' => Mage::helper('adminhtml')->__('Performed At'),
'type' => 'datetime',
'index' => 'performed_at',
- 'width' => '150px',
]);
$this->addColumn('firstname', [
diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php
index 9281183db94..5f76274eaac 100644
--- a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php
@@ -80,7 +80,6 @@ protected function _prepareColumns()
$this->addColumn('date_from', [
'header' => Mage::helper('catalogrule')->__('Date From'),
'align' => 'left',
- 'width' => '100px',
'type' => 'date',
'index' => 'date_from',
]);
@@ -88,7 +87,6 @@ protected function _prepareColumns()
$this->addColumn('date_to', [
'header' => Mage::helper('catalogrule')->__('Date To'),
'align' => 'left',
- 'width' => '100px',
'type' => 'date',
'index' => 'date_to',
]);
diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
index 73d6ab6e4b1..fc2c585243a 100644
--- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
@@ -211,6 +211,18 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget
*/
protected $_emptyCellLabel = '';
+ /**
+ * @var array[][]
+ */
+ protected $defaultColumnSettings = [
+ 'date' => [
+ 'width' => 140
+ ],
+ 'datetime' => [
+ 'width' => 160
+ ],
+ ];
+
/**
* Mage_Adminhtml_Block_Widget_Grid constructor.
* @param array $attributes
@@ -325,6 +337,9 @@ public function getCollection()
public function addColumn($columnId, $column)
{
if (is_array($column)) {
+ if (isset($column['type'], $this->defaultColumnSettings[$column['type']])) {
+ $column += $this->defaultColumnSettings[$column['type']];
+ }
$this->_columns[$columnId] = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
->setData($column)
->setGrid($this);
diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php
index 7e917d5fbaa..5a0358d759d 100644
--- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php
+++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php
@@ -144,7 +144,6 @@ protected function _prepareColumns()
$this->addColumn('ended_at', [
'header' => Mage::helper('index')->__('Updated At'),
'type' => 'datetime',
- 'width' => '180',
'align' => 'left',
'index' => 'ended_at',
'frame_callback' => [$this, 'decorateDate']
diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
index 7645c7f9696..ee75b2eea2d 100644
--- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
+++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
@@ -139,7 +139,6 @@ protected function _prepareColumns()
$this->addColumn('created_at', [
'header' => Mage::helper('sales')->__('Created At'),
'index' => 'agreement_created_at',
- 'width' => 1,
'type' => 'datetime',
'align' => 'center',
'default' => $this->__('N/A'),
@@ -149,7 +148,6 @@ protected function _prepareColumns()
$this->addColumn('updated_at', [
'header' => Mage::helper('sales')->__('Updated At'),
'index' => 'agreement_updated_at',
- 'width' => 1,
'type' => 'datetime',
'align' => 'center',
'default' => $this->__('N/A'),
diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php
index f3e9795bdc0..5f7c0e04c5e 100644
--- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php
+++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php
@@ -91,7 +91,6 @@ protected function _prepareColumns()
'index' => 'created_at',
'type' => 'datetime',
'html_decorators' => ['nobr'],
- 'width' => 1,
]);
$this->addColumn('updated_at', [
@@ -99,7 +98,6 @@ protected function _prepareColumns()
'index' => 'updated_at',
'type' => 'datetime',
'html_decorators' => ['nobr'],
- 'width' => 1,
]);
$methods = [];
diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php
index a44c4d238b0..07d7ea2747d 100644
--- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php
+++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php
@@ -83,7 +83,6 @@ protected function _prepareColumns()
'header' => Mage::helper('sales')->__('Purchased On'),
'index' => 'created_at',
'type' => 'datetime',
- 'width' => '100px',
]);
$this->addColumn('billing_name', [