Skip to content

Commit 2e2b647

Browse files
authored
Merge pull request #28 from r-martins/master
Support to updateColumn (updates an existing column)
2 parents d3e03fd + c5452dd commit 2e2b647

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Features
1313
- move columns
1414
- add new attributes
1515
- join new attributes
16+
- update columns
1617

1718
Todo
1819
-----
@@ -52,6 +53,17 @@ XML Syntax
5253
</add>
5354
</column>
5455

56+
<existingColumn>
57+
<updateColumn>
58+
<attributeToUpdate>newValue</attributeToUpdate>
59+
</updateColumn>
60+
</existingColumn>
61+
<real_order_id>
62+
<updateColumn>
63+
<filter_index>main_table.increment_id</filter_index>
64+
</updateColumn>
65+
</real_order_id>
66+
5567
<manufacturer>
5668
<add>
5769
<header>Manufacturer</header>

src/app/code/community/FireGento/GridControl/Model/Processor.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,26 @@ protected function removeGridColumn(Mage_Adminhtml_Block_Widget_Grid $grid, $col
230230
$this->setGridProtectedPropertyValue($grid, $columnsPropertyName, $columns);
231231
$this->setGridProtectedPropertyValue($grid, $lastColumnIdPropertyName, $lastColumnId);
232232
}
233+
234+
/**
235+
* Updates an existing column
236+
* Example: <status><updateColumn><filter_index>main_table.status</filter_index></updateColumn></status>
237+
* @param array $params
238+
*/
239+
protected function _updateColumnAction($params)
240+
{
241+
$columnConfig = array();
242+
$blockId = $params->getBlock()->getId();
243+
/**
244+
* @var FireGento_GridControl_Model_Config $config
245+
*/
246+
$config = Mage::getSingleton('firegento_gridcontrol/config');
247+
248+
foreach ($params->getAction()->children() as $attribute) {
249+
// $params->getBlock()->getColumn('status')->setData('index', 'main_table.status')
250+
$params->getBlock()->getColumn($params->getColumn()->getName())->setData(
251+
$attribute->getName(), (string)$attribute
252+
);
253+
}
254+
}
233255
}

0 commit comments

Comments
 (0)