{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","user":{"avatar_url":"https://secure.gravatar.com/avatar/cca0b746e08c10602025ce3a7aebc197?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cca0b746e08c10602025ce3a7aebc197","url":"https://api.github.com/users/ddmaster","login":"ddmaster","id":533094},"milestone":null,"labels":[],"updated_at":"2011-10-29T22:43:59Z","assignee":null,"comments":3,"closed_at":"2011-10-29T22:43:59Z","url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/307","body":"How can I set the sort direction and the field for the default DataGrid?\r\nAdding this option seems simple enough.\r\nWhile thought to myself this question change in the parameter \"datagridValues\".\r\nMaybe we should add a setter?","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/307","number":307,"title":"Set the default field to sort.","id":1697442,"created_at":"2011-09-21T13:29:31Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/dc68b58a2a42134405a48c008598a4f2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"dc68b58a2a42134405a48c008598a4f2","url":"https://api.github.com/users/rande","login":"rande","id":14672},"updated_at":"2011-10-29T22:43:59Z","url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments/2567385","body":"The other option is to define a propertie \r\n\r\n```php\r\n\r\n    protected $datagridValues = array(\r\n        '_page'       => 1,\r\n        '_sort_order' => 'DESC', // sort direction\r\n        '_sort_by' => 'date' // field name\r\n    );\r\n\r\n```","id":2567385,"created_at":"2011-10-29T22:43:59Z"}}