{"action":"closed","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/1867","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/1867/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/1867/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/1867/events","html_url":"https://github.com/ant-design/ant-design/issues/1867","id":157111161,"number":1867,"title":"table columns render 怎么调用父级this方法？","user":{"login":"ansonchen","id":1464133,"avatar_url":"https://avatars.githubusercontent.com/u/1464133?v=3","gravatar_id":"","url":"https://api.github.com/users/ansonchen","html_url":"https://github.com/ansonchen","followers_url":"https://api.github.com/users/ansonchen/followers","following_url":"https://api.github.com/users/ansonchen/following{/other_user}","gists_url":"https://api.github.com/users/ansonchen/gists{/gist_id}","starred_url":"https://api.github.com/users/ansonchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansonchen/subscriptions","organizations_url":"https://api.github.com/users/ansonchen/orgs","repos_url":"https://api.github.com/users/ansonchen/repos","events_url":"https://api.github.com/users/ansonchen/events{/privacy}","received_events_url":"https://api.github.com/users/ansonchen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-27T01:16:47Z","updated_at":"2016-05-27T01:29:21Z","closed_at":"2016-05-27T01:29:21Z","body":"比如：\r\n```javascript\r\nlet columns =[{\r\n  title: 'name',\r\n  dataIndex: 'name',\r\n  render(text,i) {\r\n   return (<a href=\"javascript:void(0)\" onClick={this.ModelFn.bind(null,i)}  >{text}</a>);\r\n}]\r\n```\r\n如果把ModelFn写在这个render里，不是每行都会增加一个Model ?\r\n如果写在父级\r\n```javascript\r\nlet test = React.createClass({\r\n ModelFn(i){\r\nconsole.log(i)\r\n},\r\nrender(){\r\n\r\nreturn(\r\n<div>\r\n  <Model .../>\r\n  <Table columns={columns } dataSource={data} pagination={pagination}/>\r\n</div>\r\n\r\n)\r\n}\r\n\r\n})\r\n\r\n```\r\n\r\ncolumns 里的 `onClick` 应该怎么写才能调到 test 的` ModelFn` ？"}}
{"actor":{"display_login":"benjycui"}}