Magento News

 

whitespace problem magento admin html grid renderer

I have rewritten the app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
with app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php
& have created a renderer to display customer’s email column in grid.

Here is my renderer file

<?php

class Mage_Adminhtml_Block_Renderer_Customer extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{

public function render(Varien_Object $row)
{
    $model = Mage::getModel('customer/customer')->load($row->getCustomerId());

    return  $model->getEmail();

 }

}

& here is my Grid changes (I just added a column, & I intend to make it search-able)

$this->addColumn('billing_name', array(
        'header' => Mage::helper('sales')->__('Bill to Name'),
        'index' => 'billing_name',
    ));
       // this is new col.
    $this->addColumn('customer_email', array(
        'header' => Mage::helper('sales')->__('Customer Email'),
        'renderer' => 'adminhtml/renderer_customer',

    ));

I am getting what I want. But this col & a lot of whitespace both leading & trailing
due to this I think this col. is not search-able.
Can Anybody suggest what can be done in order to remove these white spaces

Many thanks in advance

whitespace problem magento admin html grid renderer

Possibly Related Posts:


 

Leave a Reply