Exemple #1
0
 /**
  * Sets sorting order by some column
  *
  * @param \Magento\Backend\Block\Widget\Grid\Column $column
  * @return $this
  */
 protected function _setCollectionOrder($column)
 {
     $collection = $this->getCollection();
     if ($collection) {
         $columnIndex = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
         $collection->setOrder($columnIndex, strtoupper($column->getDir()));
     }
     return $this;
 }