Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I worked it out. Here is the modified piece of code that works</p> <pre><code>public function appendCustomColumn(Varien_Event_Observer $observer) { $block = $observer-&gt;getEvent()-&gt;getBlock(); if (!isset($block)) { return $this; } if ($block-&gt;getType() == 'adminhtml/permissions_tab_roleinfo') { //get form instance $form = $block-&gt;getForm(); //create new custom fieldset 'website' $fieldset = $form-&gt;addFieldset( 'website_field', array( 'legend' =&gt; 'Website Extras', 'class' =&gt; 'fieldset-wide' ) ); //add new field $fieldset-&gt;addField('website', 'text', array( 'name' =&gt; 'website', 'label' =&gt; Mage::helper('adminhtml')-&gt;__('Website'), 'title' =&gt; Mage::helper('adminhtml')-&gt;__('Website'), 'disabled' =&gt; false, )); } } </code></pre> <p>XML Configuration:</p> <pre><code>&lt;events&gt; &lt;adminhtml_block_html_before&gt; &lt;observers&gt; &lt;Event_column_append&gt; &lt;type&gt;model&lt;/type&gt; &lt;class&gt;Mymodule_Mycompany_Model_Observer&lt;/class&gt; &lt;method&gt;appendCustomColumn&lt;/method&gt; &lt;/Event_column_append&gt; &lt;/observers&gt; &lt;/adminhtml_block_html_before&gt; &lt;/events&gt; </code></pre> <ol> <li>You need to use the event 'adminhtml_block_html_before' as the event which you were using did not even create the form object. That is why you were nt able to access the form object.</li> <li>The block that is creating this form elements was 'adminhtml/permissions_tab_roleinfo'. </li> <li>The method you were using was the not same one in the observer.</li> </ol> <p>Hope that helps :)...</p> <p>Cheers, Swapna</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload