I created a column for my grid using renderer to change id to name like this:
$this->addColumn(
'city_destination',
array(
'header' => Mage::helper('test_shippingcost')->__('City Destination'),
'index' => 'city_destination',
'type'=> 'text',
'renderer' => 'Test_ShippingCost_Block_Adminhtml_Renderer_City'
)
);
But when i want try to filter the value using text, it won't budge unless i'm using id
renderer:
class Test_ShippingCost_Block_Adminhtml_Renderer_City extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
public function render(Varien_Object $row)
{
$id = $row->getData($this->getColumn()->getIndex());
$collection = Mage::getModel('test_shippingcost/city')->load($id);
$value = $collection->getName();
return $value;
}
}