I'm not sure why, but I can't filter my attribute (it works fine with defaults ones).
Here is my code :
Config.xml
<global>
<blocks>
<adminhtml>
<rewrite>
<customer_grid>SaponeWebConcept_PrivateSells_Adminhtml_Block_Customer_Grid</customer_grid>
</rewrite>
</adminhtml>
</blocks>
</global>
Grid.php
public function setCollection($collection)
{
$collection->addAttributeToSelect('wants_to_be_vip');
parent::setCollection($collection);
}
protected function _prepareColumns()
{
parent::_prepareColumns();
$attributeCollection = Mage::getResourceModel('eav/entity_attribute_collection')
->setCodeFilter('wants_to_be_vip')
->getFirstItem();
$itemsOptions = $attributeCollection->getSource()->getAllOptions(false);
$optionsArr = array();
foreach ($itemsOptions as $option) {
$optionsArr[$option['value']] = $option['label'];
}
$this->addColumn('V.I.P', array(
'header'=> Mage::helper('customer')->__('Veut devenir V.I.P'),
'index' => 'wants_to_be_vip',
'type' => 'options',
'options' => $optionsArr,
));
$this->addColumnsOrder('customer_id','wants_to_be_vip');
}
Thanks for you help !
Edit : It may need some more infos : - Values display ok. - My select box is ok too. - When I press the filter button, it loads, and nothing changes.