M
M
Maybe_V2016-07-15 17:40:31
PHP
Maybe_V, 2016-07-15 17:40:31

How to select correctly in gid?

I have an attribute in the table eav_attributethat I added myself:

$setup->addAttribute('catalog_product', 'aprove', array(
    'group'     => 'Special Attributes',
    'input'         => 'boolean',
    'type'          => 'int',
    'label'         => 'AproveProduct',
    'backend'       => '',
    'visible'       => 1,
    'required' => 0,
    'default' => 0,
    'user_defined' => 1,
    'searchable' => 1,
    'filterable' => 0,
    'comparable' => 1,
    'visible_on_front' => 1,
    'visible_in_advanced_search'  => 0,
    'is_html_allowed_on_front' => 0,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
Нужно реализовать возможность чтоб в grid отображался select и зависимо от того 0 или 1 в таблице установлено отображало yes/no з возможностью выбрать,

Делаю это так:

$this->addColumn('dropdown', array(
            'header' => $helper->__('Aprove public'),
            'filter'    => false,
            'sortable'  => false,
            'index' => 'aprove',
            'type' => 'select',
            'values' => array(1 =>'yes',  0 =>'no')
        ));

But it just throws an error!
How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
imdeveloper, 2016-08-01
@link_web

What's wrong? Turn on developer mode and you will get more information

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question