{"action":"created","issue":{"url":"https://api.github.com/repos/DataTables/DataTables/issues/425","labels_url":"https://api.github.com/repos/DataTables/DataTables/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/DataTables/DataTables/issues/425/comments","events_url":"https://api.github.com/repos/DataTables/DataTables/issues/425/events","html_url":"https://github.com/DataTables/DataTables/pull/425","id":44638490,"number":425,"title":"allow render function to assume direct control of updating cell DOM","user":{"login":"pimlottc","id":188955,"avatar_url":"https://avatars.githubusercontent.com/u/188955?v=3","gravatar_id":"","url":"https://api.github.com/users/pimlottc","html_url":"https://github.com/pimlottc","followers_url":"https://api.github.com/users/pimlottc/followers","following_url":"https://api.github.com/users/pimlottc/following{/other_user}","gists_url":"https://api.github.com/users/pimlottc/gists{/gist_id}","starred_url":"https://api.github.com/users/pimlottc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimlottc/subscriptions","organizations_url":"https://api.github.com/users/pimlottc/orgs","repos_url":"https://api.github.com/users/pimlottc/repos","events_url":"https://api.github.com/users/pimlottc/events{/privacy}","received_events_url":"https://api.github.com/users/pimlottc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2014-10-02T01:41:48Z","updated_at":"2015-06-03T16:51:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DataTables/DataTables/pulls/425","html_url":"https://github.com/DataTables/DataTables/pull/425","diff_url":"https://github.com/DataTables/DataTables/pull/425.diff","patch_url":"https://github.com/DataTables/DataTables/pull/425.patch"},"body":"This is a quick proof-of-concept patch for the idea of allowing the\r\nrender function to take full control of rendering content within a cell.\r\nInstead of returning HTML for DataTables to add to the cell, the render\r\nfunction updates the DOM directly and returns null to indicate that\r\ntouching the innerHTML is unnecessary.\r\n\r\nThis allows the view rendering code to retain references to actual dom\r\nelements on the page for event handling and UI binding.\r\n\r\nAs an example, my application is using a Backbone Marionette view for\r\neach cell's contents, binding the view to the td created by DataTables\r\nand then rendering to it directly.\r\n\r\nI first tried using column.createdCell, which gives convenient access to\r\nthe cell node, but that the initial drawing; subsequent re-displays only\r\ncall data and/or display and then overwrite the innerHTML, orphaning the\r\nprevious elements.\r\n\r\nI don't really expect this patch to be accepted directly but I wanted to\r\nopen discussion about providing some method to accomplish direct\r\nrendering control.\r\n\r\nIssues to considering\r\n\r\n  * the td node could be better exposed to the rendering function\r\n\r\nRight now, I have to dig out of the meta parameter:\r\n\r\n  meta.settings.aoData[meta.row].anCells[meta.col]\r\n\r\nbut it could be passed as a parameter, or perhaps added as e.g.\r\nmeta.node. Alternatively, the render function could be permitted to\r\ncreate and return the node itself.\r\n\r\n  * a better way to signal that the render function is handling the\r\n    rendering and that DataTables should not modify innerHTML\r\n\r\nUsing \"null\" is kinda dirty.  Could be signaled by return type\r\n(HTMLElement) or by using a different function than column.render which\r\nalways handles rendering"},"comment":{"url":"https://api.github.com/repos/DataTables/DataTables/issues/comments/108521075","html_url":"https://github.com/DataTables/DataTables/pull/425#issuecomment-108521075","issue_url":"https://api.github.com/repos/DataTables/DataTables/issues/425","id":108521075,"user":{"login":"foo123","id":1263582,"avatar_url":"https://avatars.githubusercontent.com/u/1263582?v=3","gravatar_id":"","url":"https://api.github.com/users/foo123","html_url":"https://github.com/foo123","followers_url":"https://api.github.com/users/foo123/followers","following_url":"https://api.github.com/users/foo123/following{/other_user}","gists_url":"https://api.github.com/users/foo123/gists{/gist_id}","starred_url":"https://api.github.com/users/foo123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foo123/subscriptions","organizations_url":"https://api.github.com/users/foo123/orgs","repos_url":"https://api.github.com/users/foo123/repos","events_url":"https://api.github.com/users/foo123/events{/privacy}","received_events_url":"https://api.github.com/users/foo123/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T16:51:34Z","updated_at":"2015-06-03T16:51:34Z","body":"btw the actual issue with datatables that i was looking for was a way to customize the wrapper/filters section not with javascript but at render time (meaning with actual html code before rendering the table withg datatables). Any ideas how to do that?? Thank you very much and kudos for the plugin (use it for data tables since i came accross it) :)"}}