{"action":"created","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1634","repository_url":"https://api.github.com/repos/yajra/laravel-datatables","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1634/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1634/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1634/events","html_url":"https://github.com/yajra/laravel-datatables/issues/1634","id":298412939,"number":1634,"title":"Column Visibility","user":{"login":"Skintillion","id":1521506,"avatar_url":"https://avatars0.githubusercontent.com/u/1521506?v=4","gravatar_id":"","url":"https://api.github.com/users/Skintillion","html_url":"https://github.com/Skintillion","followers_url":"https://api.github.com/users/Skintillion/followers","following_url":"https://api.github.com/users/Skintillion/following{/other_user}","gists_url":"https://api.github.com/users/Skintillion/gists{/gist_id}","starred_url":"https://api.github.com/users/Skintillion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skintillion/subscriptions","organizations_url":"https://api.github.com/users/Skintillion/orgs","repos_url":"https://api.github.com/users/Skintillion/repos","events_url":"https://api.github.com/users/Skintillion/events{/privacy}","received_events_url":"https://api.github.com/users/Skintillion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-19T22:04:16Z","updated_at":"2018-02-26T13:57:11Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Summary of problem or feature request\r\n\r\nUnable to hide columns when using Datatables as a service. When the page first loads, the columns marked visible => false, are indeed hidden, but once the ajax loads, they are once again visible.\r\n\r\nAny suggestions? Thanks so much!\r\n\r\n### Code snippet of problem\r\n\r\nController\r\n\r\n```\r\nuse App\\DataTables\\ModelDataTable;\r\n\r\nclass ModelController extends Controller\r\n{\r\n    public function index(ModelDataTable $dataTable)\r\n    {\r\n        return $dataTable->render('model.index');\r\n    }\r\n}\r\n```\r\n\r\nView\r\n\r\n```\r\n{!! $dataTable->table() !!}\r\n{!! $dataTable->scripts() !!}\r\n```\r\n\r\nModelDataTable\r\n\r\n```\r\nclass ModelDataTable extends DataTable\r\n{    \r\n    public function ajax()\r\n    {\r\n        $result =  $this->datatables\r\n            ->eloquent($this->query())\r\n            ->make(true);\r\n        return $result;\r\n    }\r\n\r\n    public function query()\r\n    {\r\n        //Relationships\r\n\t\t$model = Guarantee::all();\r\n        return $this->applyScopes($guarantees);\r\n    }\r\n\r\n\r\n    public function html()\r\n    {\r\n        return $this->builder()\r\n            ->columns($this->getColumns())\r\n            ->parameters([\r\n                'dom' => 'lBfrtip',\r\n                'stateSave' => false,//true,\r\n                'bScrollInfinite' => true,\r\n                'responsive' => true,\r\n                'lengthMenu' => [10, 15, 30, 50, 100],\r\n                'buttons' => ['copy', 'csv', 'excel', 'print', 'reset'],\r\n                'processing' => true,\r\n                'serverSide' => true,\r\n                \r\n            ]);\r\n    }\r\n\r\n    protected function getColumns()\r\n    {\r\n        return  [\r\n            [\r\n                \"orderable\" => false,\r\n                \"searchable\" => false,\r\n                \"title\" => \"ID\",\r\n                \"data\" => \"id\",\r\n            ],\r\n            [\r\n                'name' => 'type_id',\r\n                \"searchable\" => false,\r\n                \"title\" => \"Type\",\r\n                \"data\" => \"type\",\r\n            ],\r\n            [\r\n                'name' => 'tag',\r\n                \"searchable\" => false,\r\n                \"title\" => \"Tag\",\r\n                \"data\" => \"tag\",\r\n\t\t\"visible\" => false,\r\n            ],            \r\n        ];\r\n    }\r\n}\r\n```\r\n\r\n\r\n\r\n### System details\r\n\r\n- PHP Version - 7.1.1\r\n- Laravel Version - 5.4\r\n- Laravel-Datatables Version - 7\r\n"},"comment":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/comments/368511352","html_url":"https://github.com/yajra/laravel-datatables/issues/1634#issuecomment-368511352","issue_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1634","id":368511352,"user":{"login":"rokde","id":4946056,"avatar_url":"https://avatars3.githubusercontent.com/u/4946056?v=4","gravatar_id":"","url":"https://api.github.com/users/rokde","html_url":"https://github.com/rokde","followers_url":"https://api.github.com/users/rokde/followers","following_url":"https://api.github.com/users/rokde/following{/other_user}","gists_url":"https://api.github.com/users/rokde/gists{/gist_id}","starred_url":"https://api.github.com/users/rokde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rokde/subscriptions","organizations_url":"https://api.github.com/users/rokde/orgs","repos_url":"https://api.github.com/users/rokde/repos","events_url":"https://api.github.com/users/rokde/events{/privacy}","received_events_url":"https://api.github.com/users/rokde/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T13:57:11Z","updated_at":"2018-02-26T13:57:11Z","author_association":"NONE","body":"`responsive` setting to false does not handle the column visibility `visible = false`. This does not work as you mentioned before."}}
{"actor":{"display_login":"rokde"}}