{"action":"closed","issue":{"url":"https://api.github.com/repos/ceolter/ag-grid-react/issues/7","repository_url":"https://api.github.com/repos/ceolter/ag-grid-react","labels_url":"https://api.github.com/repos/ceolter/ag-grid-react/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ceolter/ag-grid-react/issues/7/comments","events_url":"https://api.github.com/repos/ceolter/ag-grid-react/issues/7/events","html_url":"https://github.com/ceolter/ag-grid-react/issues/7","id":137707063,"number":7,"title":"reactCellRendererFactory should accept additional props.","user":{"login":"andrewtpoe","id":11183459,"avatar_url":"https://avatars.githubusercontent.com/u/11183459?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewtpoe","html_url":"https://github.com/andrewtpoe","followers_url":"https://api.github.com/users/andrewtpoe/followers","following_url":"https://api.github.com/users/andrewtpoe/following{/other_user}","gists_url":"https://api.github.com/users/andrewtpoe/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewtpoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewtpoe/subscriptions","organizations_url":"https://api.github.com/users/andrewtpoe/orgs","repos_url":"https://api.github.com/users/andrewtpoe/repos","events_url":"https://api.github.com/users/andrewtpoe/events{/privacy}","received_events_url":"https://api.github.com/users/andrewtpoe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-03-01T22:35:18Z","updated_at":"2016-08-31T10:19:48Z","closed_at":"2016-08-31T10:19:48Z","body":"Hello. Thank you for making the wonderful ag-grid and ag-grid-react libraries. They have been enormously helpful for me.\r\n\r\nI have a suggestion that I believe would enhance the usability of this library. I am using functional programming to develop a react/redux application and require the ability to pass additional props in to the react cell render factory function. I am building cell renderers that convert to editable forms, and need to trigger actions in my container via `onChange` or `onClick` in the cells. These actions must be passed in as props.\r\n\r\nI have modified the renderer so that it allows me to do this using ES6. I am unfamiliar with TypeScript and it will require research on my part before I can submit a proper pull request, however, I will post my solution here in case this will help someone else. Feel free to transpose this over to TypeScript if you are familiar with the library and no pull request has been submitted yet.\r\n\r\n```JavaScript\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\n\r\nconst cellRenderer = (reactComponent, { ...props }) => (params) => {\r\n  params.eParentOfValue.addElementAttachedListener((eCell) => {\r\n    ReactDOM.render(React.createElement(reactComponent, { ...props, params }), eCell);\r\n    params.api.addVirtualRowListener('virtualRowRemoved', params.rowIndex, () => {\r\n      ReactDOM.unmountComponentAtNode(eCell);\r\n    });\r\n  });\r\n  return null;\r\n};\r\n\r\nexport default cellRenderer;\r\n```\r\n\r\nUsing this as a cell renderer allows me pass in additional props in the following fashion while building my column definitions: \r\n```JavaScript\r\ncellRenderer: cellRenderer(someCellRenderer, {\r\n  testAction: this.testAction,\r\n}),\r\n```\r\n\r\nThe props in `someCellRenderer` is now: \r\n```JavaScript\r\nconsole.log(this.props);\r\n{\r\n  testAction: function();\r\n  params: Object;\r\n}\r\n```\r\n\r\nThank you again for your wonderful libraries. "}}
{"actor":{"display_login":"ceolter"}}