1

i am using this following code to export my grid:

/**
* Export order grid to CSV format
*/
public function exportCsvAction()
{
   $fileName   = 'orders.csv';
   $grid       = $this->getLayout()->createBlock('adminhtml/sales_order_grid');
   $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
}

how do i sort the exported data by specific column?

1 Answer 1

1

there's Mage_Adminhtml_Block_Widget_Grid class, please check it, you may find some useful things there :)

/**
 * Add column view order
 *
 * @param string $columnId
 * @param string $after
 * @return Mage_Adminhtml_Block_Widget_Grid
 */
public function addColumnsOrder($columnId, $after)
{
    $this->_columnsOrder[$columnId] = $after;
    return $this;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.