public function setColumnsOrder($order)
	{
		$new_order = [];

		foreach ($order as $key) {
			if (isset($this->columns[$key])) {
				$new_order[$key] = $this->columns[$key];
			}
		}

		if (sizeof($new_order) === sizeof($this->columns)) {
			$this->columns = $new_order;
		} else {
			throw new DataGridException('When changing columns order, you have to specify all columns');
		}

		return $this;
	}
public function setColumnsOrder($order)
	{
		$new_order = [];

		foreach ($order as $key) {
			if (isset($this->columns[$key])) {
				$new_order[$key] = $this->columns[$key];
			}
		}

		if (sizeof($new_order) === sizeof($this->columns)) {
			$this->columns = $new_order;
		} else {
			throw new DataGridException('When changing columns order, you have to specify all columns');
		}

		return $this;
	}
public function setColumnsOrder ( $ order ) { $ new_order = [ ] ; foreach ( $ order as $ key ) { if ( isset ( $ this -> columns [ $ key ] ) ) { $ new_order [ $ key ] = $ this -> columns [ $ key ] ; } } if ( sizeof ( $ new_order ) === sizeof ( $ this -> columns ) ) { $ this -> columns = $ new_order ; } else { throw new DataGridException ( 'When changing columns order, you have to specify all columns' ) ; } return $ this ; }
Set order of datagrid columns
@param array $order
@return static
Set order of datagrid columns