{"action":"created","issue":{"url":"https://api.github.com/repos/atatanasov/gijgo/issues/84","repository_url":"https://api.github.com/repos/atatanasov/gijgo","labels_url":"https://api.github.com/repos/atatanasov/gijgo/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/atatanasov/gijgo/issues/84/comments","events_url":"https://api.github.com/repos/atatanasov/gijgo/issues/84/events","html_url":"https://github.com/atatanasov/gijgo/issues/84","id":228788069,"number":84,"title":"Grid - Enhancement","user":{"login":"stvowi","id":1979226,"avatar_url":"https://avatars2.githubusercontent.com/u/1979226?v=3","gravatar_id":"","url":"https://api.github.com/users/stvowi","html_url":"https://github.com/stvowi","followers_url":"https://api.github.com/users/stvowi/followers","following_url":"https://api.github.com/users/stvowi/following{/other_user}","gists_url":"https://api.github.com/users/stvowi/gists{/gist_id}","starred_url":"https://api.github.com/users/stvowi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stvowi/subscriptions","organizations_url":"https://api.github.com/users/stvowi/orgs","repos_url":"https://api.github.com/users/stvowi/repos","events_url":"https://api.github.com/users/stvowi/events{/privacy}","received_events_url":"https://api.github.com/users/stvowi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-15T17:33:55Z","updated_at":"2017-05-18T06:50:47Z","closed_at":"2017-05-18T06:50:47Z","body":"I prefer to work with the ajax datasource.\r\nI have to display the sum of the values of an colum at the end of the grid (footer).\r\n\r\nIs there an easy solution?"},"comment":{"url":"https://api.github.com/repos/atatanasov/gijgo/issues/comments/302316865","html_url":"https://github.com/atatanasov/gijgo/issues/84#issuecomment-302316865","issue_url":"https://api.github.com/repos/atatanasov/gijgo/issues/84","id":302316865,"user":{"login":"atatanasov","id":11516772,"avatar_url":"https://avatars2.githubusercontent.com/u/11516772?v=3","gravatar_id":"","url":"https://api.github.com/users/atatanasov","html_url":"https://github.com/atatanasov","followers_url":"https://api.github.com/users/atatanasov/followers","following_url":"https://api.github.com/users/atatanasov/following{/other_user}","gists_url":"https://api.github.com/users/atatanasov/gists{/gist_id}","starred_url":"https://api.github.com/users/atatanasov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atatanasov/subscriptions","organizations_url":"https://api.github.com/users/atatanasov/orgs","repos_url":"https://api.github.com/users/atatanasov/repos","events_url":"https://api.github.com/users/atatanasov/events{/privacy}","received_events_url":"https://api.github.com/users/atatanasov/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T06:50:47Z","updated_at":"2017-05-18T06:50:47Z","body":"You can use dataBound event in order to attach summary in the grid.\r\nThis is a simple example:\r\n```\r\n<table id=\"grid\"></table>\r\n <script>\r\n     var grid = $('#grid').grid({\r\n         dataSource: '/Players/Get',\r\n         columns: [ { field: 'ID' }, { field: 'Name' }, { field: 'PlaceOfBirth' } ],\r\n       pager: {limit: 5}\r\n     });\r\n     grid.on('dataBound', function (e, records, totalRecords) {\r\n         var sum = 0, $tfoot;\r\n         $.each(records, function() {\r\n           sum += this.ID;\r\n         });\r\n         $tfoot = grid.children('tfoot');\r\n         $tfoot.children('tr[data-role=\"summary\"]').remove();\r\n         $tfoot.prepend('<tr data-role=\"summary\"><th>'+sum+'</th><th></th><th></th></tr>');\r\n     });\r\n </script>\r\n```"}}
{"actor":{"display_login":"atatanasov"}}