{"action":"closed","issue":{"url":"https://api.github.com/repos/uxcore/uxcore-grid/issues/35","labels_url":"https://api.github.com/repos/uxcore/uxcore-grid/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/uxcore/uxcore-grid/issues/35/comments","events_url":"https://api.github.com/repos/uxcore/uxcore-grid/issues/35/events","html_url":"https://github.com/uxcore/uxcore-grid/issues/35","id":110459792,"number":35,"title":"item 的 actions 的 callback 中加入内置方法的调用","user":{"login":"eternalsky","id":8038928,"avatar_url":"https://avatars.githubusercontent.com/u/8038928?v=3","gravatar_id":"","url":"https://api.github.com/users/eternalsky","html_url":"https://github.com/eternalsky","followers_url":"https://api.github.com/users/eternalsky/followers","following_url":"https://api.github.com/users/eternalsky/following{/other_user}","gists_url":"https://api.github.com/users/eternalsky/gists{/gist_id}","starred_url":"https://api.github.com/users/eternalsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternalsky/subscriptions","organizations_url":"https://api.github.com/users/eternalsky/orgs","repos_url":"https://api.github.com/users/eternalsky/repos","events_url":"https://api.github.com/users/eternalsky/events{/privacy}","received_events_url":"https://api.github.com/users/eternalsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-08T14:11:33Z","updated_at":"2015-10-12T11:43:31Z","closed_at":"2015-10-12T11:43:31Z","body":"actions 里的 callback 有时无法通过 refs 拿到 grid 的实例，从而无法调用 API。\r\n场景：\r\n```javascript\r\nrender() {\r\n  var Grid = <Grid ref=\"grid\" />\r\n  return ( \r\n<div>\r\n   <SomeComp comp={Grid}/> // 在这样的情况下 refs 拿不到 grid，拿不到 grid 的原因，是因为 Grid 并没有在 render 里实例化，如果是以子元素方式传进去，就没有这个问题。\r\n</div>\r\n);\r\n}\r\n\r\n``` \r\n这种场景出现在 uxcore-fis-grid 中，因为填写 url 和 模板就可以完成某些功能，所以 comp 就必须要传进去了。\r\n\r\n目前想到的解决方法是\r\n```javascript\r\nactions: {\r\n    '增加': function(rowData, actions) {actions.addEmptyRow()}\r\n}\r\n\r\n```"}}