php - Magento: Show different action links in on column in the backend data grid -



php - Magento: Show different action links in on column in the backend data grid -

im working on custom product list in magento backend.

heres code using add together row:

$this->addcolumn('action_widget', array( 'header' => mage::helper('catalog')->__('action'), 'width' => '110px', 'type' => 'action', 'getter' => 'getid', 'actions' => array( array( 'caption' => mage::helper('catalog')->__('create widget'), 'url' => array( 'base'=>'*/*/create_widget', 'params'=>array('store'=>$this->getrequest()->getparam('store')) ), 'field' => 'id' ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores', ));

that works preferred.

but want display action link when widget created (update widget) instead of create link. know widget isalready created joined collection attribute null when doesn't exists or string when exist.

i've tried utilize custom grid template file, set {actionassign} 'variable' url , assign in template, magento url validation denied that.

is there way without huge workaround?

if not, possible create disabled links depending on attribute in product collection?

thanks everyone! mru

you need create custom grid column renderer this:

create class , override _transformactiondata() or render() method, depends on need:

class mycompany_mymodule_block_adminhtml_template_grid_renderer_myrendered extends mage_adminhtml_block_widget_grid_column_renderer_action { ... }

tell magento utilize custom renderer column:

// ... 'filter' => false, 'renderer' => 'mycompany_mymodule/adminhtml_template_grid_renderer_myrenderer', 'sortable' => false, 'index' => 'stores', // ...

php magento custom-action backend

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -