{"action":"created","issue":{"url":"https://api.github.com/repos/tannerlinsley/react-table/issues/101","repository_url":"https://api.github.com/repos/tannerlinsley/react-table","labels_url":"https://api.github.com/repos/tannerlinsley/react-table/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/tannerlinsley/react-table/issues/101/comments","events_url":"https://api.github.com/repos/tannerlinsley/react-table/issues/101/events","html_url":"https://github.com/tannerlinsley/react-table/issues/101","id":210682279,"number":101,"title":"[QUESTION] How to get sum of column values in footer. ","user":{"login":"vinodkhandelwal","id":3241699,"avatar_url":"https://avatars1.githubusercontent.com/u/3241699?v=3","gravatar_id":"","url":"https://api.github.com/users/vinodkhandelwal","html_url":"https://github.com/vinodkhandelwal","followers_url":"https://api.github.com/users/vinodkhandelwal/followers","following_url":"https://api.github.com/users/vinodkhandelwal/following{/other_user}","gists_url":"https://api.github.com/users/vinodkhandelwal/gists{/gist_id}","starred_url":"https://api.github.com/users/vinodkhandelwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinodkhandelwal/subscriptions","organizations_url":"https://api.github.com/users/vinodkhandelwal/orgs","repos_url":"https://api.github.com/users/vinodkhandelwal/repos","events_url":"https://api.github.com/users/vinodkhandelwal/events{/privacy}","received_events_url":"https://api.github.com/users/vinodkhandelwal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-02-28T04:13:09Z","updated_at":"2017-02-28T16:52:52Z","closed_at":null,"body":"I need to sum the column values and show that in footer. Footer Demo seems to have missing the code. "},"comment":{"url":"https://api.github.com/repos/tannerlinsley/react-table/issues/comments/283097094","html_url":"https://github.com/tannerlinsley/react-table/issues/101#issuecomment-283097094","issue_url":"https://api.github.com/repos/tannerlinsley/react-table/issues/101","id":283097094,"user":{"login":"tannerlinsley","id":5580297,"avatar_url":"https://avatars3.githubusercontent.com/u/5580297?v=3","gravatar_id":"","url":"https://api.github.com/users/tannerlinsley","html_url":"https://github.com/tannerlinsley","followers_url":"https://api.github.com/users/tannerlinsley/followers","following_url":"https://api.github.com/users/tannerlinsley/following{/other_user}","gists_url":"https://api.github.com/users/tannerlinsley/gists{/gist_id}","starred_url":"https://api.github.com/users/tannerlinsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannerlinsley/subscriptions","organizations_url":"https://api.github.com/users/tannerlinsley/orgs","repos_url":"https://api.github.com/users/tannerlinsley/repos","events_url":"https://api.github.com/users/tannerlinsley/events{/privacy}","received_events_url":"https://api.github.com/users/tannerlinsley/received_events","type":"User","site_admin":false},"created_at":"2017-02-28T16:52:52Z","updated_at":"2017-02-28T16:52:52Z","body":"Try this:\r\n```javascript\r\nconst AccountsGrid = (props) => {\r\n\r\n    var marketValSum = 0;\r\n    var cashSum = 0;\r\n    \r\n    const accountData = props.accounts;\r\n    \r\n    if(accountData.length >0) {\r\n        for (let i = 0; i < accountData.length; i++) {\r\n          marketValSum += accountData[i].marketValue;\r\n          cashSum += accountData[i].cash;\r\n        }\r\n    }\r\n\r\n    const columns = [\r\n      { accessor: 'name', header: 'Name',width: 205 },\r\n      { accessor: 'marketValue', header: 'Market Value', footer: 'Total: ' + marketValSum},\r\n      { accessor: 'cash', header: 'Cash', footer: 'Total: ' + cashSum}\r\n    ]\r\n\r\n    return (\r\n      <ReactTable\r\n        columns={columns}\r\n        data={props.accounts}\r\n        className='-striped -highlight'\r\n        defaultPageSize={10}\r\n      />\r\n    );\r\n};\r\n```"}}
{"actor":{"display_login":"tannerlinsley"}}