{"action":"created","issue":{"url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/2","labels_url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/2/comments","events_url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/2/events","html_url":"https://github.com/NullRefExcep/yii2-datatables/issues/2","id":53659819,"number":2,"title":"DataTableAction.php bug","user":{"login":"irekbar","id":10426826,"avatar_url":"https://avatars.githubusercontent.com/u/10426826?v=3","gravatar_id":"","url":"https://api.github.com/users/irekbar","html_url":"https://github.com/irekbar","followers_url":"https://api.github.com/users/irekbar/followers","following_url":"https://api.github.com/users/irekbar/following{/other_user}","gists_url":"https://api.github.com/users/irekbar/gists{/gist_id}","starred_url":"https://api.github.com/users/irekbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irekbar/subscriptions","organizations_url":"https://api.github.com/users/irekbar/orgs","repos_url":"https://api.github.com/users/irekbar/repos","events_url":"https://api.github.com/users/irekbar/events{/privacy}","received_events_url":"https://api.github.com/users/irekbar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-07T17:44:19Z","updated_at":"2015-01-08T13:19:28Z","closed_at":null,"body":"Order by not work correctly.\r\nError line: $actionQuery->addOrderBy([$columns[$key]['data'] => $sort]);\r\nAfter correction: $actionQuery->addOrderBy([$columns[$item['column']]['data'] => $sort]);"},"comment":{"url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/comments/69177688","html_url":"https://github.com/NullRefExcep/yii2-datatables/issues/2#issuecomment-69177688","issue_url":"https://api.github.com/repos/NullRefExcep/yii2-datatables/issues/2","id":69177688,"user":{"login":"irekbar","id":10426826,"avatar_url":"https://avatars.githubusercontent.com/u/10426826?v=3","gravatar_id":"","url":"https://api.github.com/users/irekbar","html_url":"https://github.com/irekbar","followers_url":"https://api.github.com/users/irekbar/followers","following_url":"https://api.github.com/users/irekbar/following{/other_user}","gists_url":"https://api.github.com/users/irekbar/gists{/gist_id}","starred_url":"https://api.github.com/users/irekbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irekbar/subscriptions","organizations_url":"https://api.github.com/users/irekbar/orgs","repos_url":"https://api.github.com/users/irekbar/repos","events_url":"https://api.github.com/users/irekbar/events{/privacy}","received_events_url":"https://api.github.com/users/irekbar/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T13:19:28Z","updated_at":"2015-01-08T13:19:28Z","body":"Example of use:\r\n```\r\n1. In Controller add following lines:\r\n    public function actions() {\r\n        return [\r\n            'datatables' => [\r\n                'class' => 'nullref\\datatable\\DataTableAction',\r\n// I use query instead of search model. To define query you can use any ActiveRecord Model eg.\r\n                'query' => Employee::find(),\r\n            ],\r\n        ];\r\n    }\r\n```\r\n2. In View file add:\r\n```\r\n<?= \\nullref\\datatable\\DataTable::widget([\r\n                            'serverSide' => true,\r\n                            'ajax' => 'datatables',\r\n// define additional parameters \r\n                            'tableOptions' => ['class' => 'table table-striped table-bordered', 'width' => '100%'],\r\n                            'scrollX' => true,  \r\n//list columns names which you want to show \r\n                           'columns' => [\r\n                                'id',\r\n                                'first_name',\r\n                                'last_name',\r\n                                'type',\r\n                                'city',\r\n                                'zip',\r\n                                'street',\r\n                                'email',\r\n                                'phone',\r\n                                //other columns\r\n    ]) \r\n?>\r\n```"}}