0
votes

We are creating a custom module in magento and want to displaying a product list in admin panel using magento grid.

As this grid showing a checkbox column to perform mass actions and this checkbox column taking product id as checkbox value.

But, we want to set different column value for checkbox column like product attribute set id. So, there is any way to change the value of checkbox set value as the attribute set id instead of product id on column value.

Please give me the solution to how to do that so that we can change the value of checkbox column.

1

1 Answers

0
votes

The checkboxes appears from the function

_prepareMassaction()

in your grid. Have a look at this function

protected function _prepareMassaction()
    {
        $this->setMassactionIdField('entity_id');

Below code sets the id.

   $this->setMassactionIdField('entity_id');

The entity id is coming from the collection you get from the function

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

If you can modify this collection to get your attribute set id here. than you can use that id in the

   $this->setMassactionIdField('entity_id');

To achieve what you need.

Hope this will help.