1

I wanted design my admin from with following field type

enter image description here

Can any one tell me How can I implement this in Magento admin form.? How Edit/new will work with this? Thanks

1 Answer 1

1

you will need a custom renderer for the field.
you can create your own class, let's call it [Namespace]_[Module]_Block_Adminhtml_Friendly_Multiselect.
This class can extend Varien_Data_Form_Element_Multiselect.
And all you have to do is to rewrite the getElementHtml in your class so you can append your second multselect and the buttons between them.

Then, in order to use this in your form you should add this in your form file right after $fieldset = $form->addFieldset(

 $fieldset->addType(
        'friendly_multiselect',
        Mage::getConfig()->getBlockClassName('[module_alias]/adminhtml_friendly_multiselect')
    );

then you can define your field like this

$fieldset->addField(
   'field_name_here',
   'friendly_multiselect',
   array(configurations go here)
);

Then all your fields with type friendly_multiselect should be rendered using your class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.