PHP Magento Tips

Powered by Blogger.

How to Add Color Picker In Magento Admin Grid in Custom Module

Rate this posting:

It is very easy to add color picker In magento admin grid for your Custom Module. Just follow below step:

Step 1: Go to your Module Admin Form file and find field where you want to add color picker.

Example: Go in file app/code/community/mycompany/mymodule/Block/Adminhtml/entity_code/Edit/Tab/Form.php

(Go to your file with appropriate path)

and find $fieldset->addField function and pass class name parameter properly.

$fieldset->addField('backgroundcolor', 'text', array(

          'label'     => Mage::helper('mycompany_mymodule')->__('Background Color'),

          'name'      => 'backgroundcolor',

          'class'     => 'color {required:true, adjust:true, hash:true} validate-hex',

          'required'  => true,


here, 'class'     => 'color {required:true, adjust:true, hash:true} is important for color picker.

Now, in your adminhtml layout update file add jscolor.js javascript to initialize colorpicker.

And optionally add jquery-3.1.1.min.js if its not working.

    <reference name="head">
    <action method="addJs">
         <script>yourmodulefolder/jquery-3.1.1.min.js</script><!--this is optional file // if not working then add this -->
    <action method="addJs">

Hope This Post will help someone.

Thanks for reading.....👥
Tag : Magento
1 Comments On "How to Add Color Picker In Magento Admin Grid in Custom Module"

This is a great post. Your Blog the very informative i have learned some information about your blog. We are top Mobile App Development.

Back To Top