I have a custom admin grid, which shows the feedback given by customers during checkout. I have 19 fields in the custom_table including entity_id, created_at and updated_at.
This is my form view:
This is my grid view:
everything works fine. Now when I export the grid as csv/ xml/ excel, it would only export the fields in the grid, but I want all the data in my database-table to be exported. How can I do that? Also If i apply filter in that grid, only those rows should be exported.
note: customer name and email_id are displayed by joining the sales/order table
This is my _prepareCollection() function in Grid.php
protected function _prepareCollection(){
$collection = Mage::getModel('feedbacktest/feedback')->getCollection();
// join the order table to display in the grid.
$collection->join('sales/order', 'increment_id=order_id', array('orderId'=>'entity_id', 'custName'=>'concat(customer_firstname," ",customer_lastname)', 'custEmail'=>'customer_email'), null,'left');
$this->setCollection($collection);
return parent::_prepareCollection();
}
Collection gives me all the data (as I require), but exported data contains only the data in the grid.
Can someone help me on this?