yiisoft/yii2 — pull request #5498 by SDKiller (2014-10-12 08:22:25+00:00)
Title: Modify yii\data\Sort to work also with $_POST

Currently `Sort` works only with `$_GET` sort parameter.
Thus, for example combination of `GridView` and search form with method `post` does not work at all.

Proposed change is an attempt to make `Sort` accept `$_POST` also.

Example usage

Search model:

```
...
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'transaction_date' => SORT_DESC
],
'dataMethod' => 'post',
'formName' => $this->formName()
]
]);
...
```

GridView:
```
...
'columns' => [
...
[
'attribute' => 'transaction_date',
'sortLinkOptions' => [
'data-method' => 'post',
'href' => '#',
'onclick' => 'jQuery(\'#'.Html::getInputId($searchModel, $dataProvider->getSort()->sortParam).'\').val(jQuery(this).data(\'sort\')).closest(\'form\').submit();'
],
],
...
```

Search form:

```
...
getSort()->sortParam), '', ['id' => Html::getInputId($model, $dataProvider->getSort()->sortParam)]); ?>
...
```