{"action":"closed","issue":{"url":"https://api.github.com/repos/stwe/DatatablesBundle/issues/339","repository_url":"https://api.github.com/repos/stwe/DatatablesBundle","labels_url":"https://api.github.com/repos/stwe/DatatablesBundle/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/stwe/DatatablesBundle/issues/339/comments","events_url":"https://api.github.com/repos/stwe/DatatablesBundle/issues/339/events","html_url":"https://github.com/stwe/DatatablesBundle/issues/339","id":150109433,"number":339,"title":"Put scripts in .js files","user":{"login":"stephanvierkant","id":601833,"avatar_url":"https://avatars.githubusercontent.com/u/601833?v=3","gravatar_id":"","url":"https://api.github.com/users/stephanvierkant","html_url":"https://github.com/stephanvierkant","followers_url":"https://api.github.com/users/stephanvierkant/followers","following_url":"https://api.github.com/users/stephanvierkant/following{/other_user}","gists_url":"https://api.github.com/users/stephanvierkant/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanvierkant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanvierkant/subscriptions","organizations_url":"https://api.github.com/users/stephanvierkant/orgs","repos_url":"https://api.github.com/users/stephanvierkant/repos","events_url":"https://api.github.com/users/stephanvierkant/events{/privacy}","received_events_url":"https://api.github.com/users/stephanvierkant/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-21T15:30:36Z","updated_at":"2016-04-30T17:34:11Z","closed_at":"2016-04-30T17:34:11Z","body":"I've got a page with multiple Datatables. All is working fine, but for every table, `views/Datatable/render_functions.html.twig` is rendered. That looks a bit unnecessary to me. There are no dynamic elements in this file.\r\n\r\nI'd like to put this script in a separate file so it will be loaded only once per page (and it can be cached too!). That will improve performance in both rendering and loading/downloading time. Some parts of ``Resources/views/Datatable/datatable_js.html.twig`` can be put in a separate file too.\r\n\r\nAny ideas how to implement this? I'd love to make a PR, but I'm not sure what's the best way to achieve this. I don't want to rely on third party tools (i.e. Assetic)."}}