Showing posts with label Multiple Values Selected. Show all posts
Showing posts with label Multiple Values Selected. Show all posts

Thursday 25 January 2018

How to keep multiple values selected dropdown in magento addField (multiselect)



$filterData = $this->helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter', false));
$fieldset->addField('warehouse', 'multiselect', array(
            'label' => Mage::helper('namespace_reports')->__('Warehouse'),
            'title' => Mage::helper('namespace_reports')->__('Select multiple warehouse'),
            'name' => 'warehouse',
            'values' => $this->_getWarehouseArr(),
            'value' => isset($filterData['warehouse'][0]) ? explode(',', $filterData['warehouse'][0]) : array(),
            'style' => 'height:43px'
        ));