{"action":"created","issue":{"url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/47","labels_url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/47/comments","events_url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/47/events","html_url":"https://github.com/tsega/meteor-bootstrap3-datetimepicker/issues/47","id":109327229,"number":47,"title":"$('.datepicker') not found if inside an {{ if }} block","user":{"login":"dsjoerg","id":783273,"avatar_url":"https://avatars.githubusercontent.com/u/783273?v=3","gravatar_id":"","url":"https://api.github.com/users/dsjoerg","html_url":"https://github.com/dsjoerg","followers_url":"https://api.github.com/users/dsjoerg/followers","following_url":"https://api.github.com/users/dsjoerg/following{/other_user}","gists_url":"https://api.github.com/users/dsjoerg/gists{/gist_id}","starred_url":"https://api.github.com/users/dsjoerg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsjoerg/subscriptions","organizations_url":"https://api.github.com/users/dsjoerg/orgs","repos_url":"https://api.github.com/users/dsjoerg/repos","events_url":"https://api.github.com/users/dsjoerg/events{/privacy}","received_events_url":"https://api.github.com/users/dsjoerg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-01T15:44:37Z","updated_at":"2015-10-05T16:08:08Z","closed_at":null,"body":"Hi, this may be more of a meteor issue than a meteor-bootstrap3-datetimepicker issue, but I'll file it here in case you realize that it is not a meteor issue.\r\n\r\nI have found that if my datetimepicker component happens to be inside an {{ if }} block inside my template, it won't be found by jquery, and instead there will be a prevObject there.  But once I refactored my template so that the datetimepicker had no enclosing {{ if }} block, then everything worked as expected.\r\n"},"comment":{"url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/comments/145584032","html_url":"https://github.com/tsega/meteor-bootstrap3-datetimepicker/issues/47#issuecomment-145584032","issue_url":"https://api.github.com/repos/tsega/meteor-bootstrap3-datetimepicker/issues/47","id":145584032,"user":{"login":"dsjoerg","id":783273,"avatar_url":"https://avatars.githubusercontent.com/u/783273?v=3","gravatar_id":"","url":"https://api.github.com/users/dsjoerg","html_url":"https://github.com/dsjoerg","followers_url":"https://api.github.com/users/dsjoerg/followers","following_url":"https://api.github.com/users/dsjoerg/following{/other_user}","gists_url":"https://api.github.com/users/dsjoerg/gists{/gist_id}","starred_url":"https://api.github.com/users/dsjoerg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsjoerg/subscriptions","organizations_url":"https://api.github.com/users/dsjoerg/orgs","repos_url":"https://api.github.com/users/dsjoerg/repos","events_url":"https://api.github.com/users/dsjoerg/events{/privacy}","received_events_url":"https://api.github.com/users/dsjoerg/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T16:08:07Z","updated_at":"2015-10-05T16:08:07Z","body":"Jquery was found correctly, that wasnt the problem. The problem was that the DOM element was not found, and instead there was a prevObject in its place.\n\n\n\n—\nSent from Mailbox\n\nOn Mon, Oct 5, 2015 at 12:01 PM, Tsegaselassie Tadesse\n<notifications@github.com> wrote:\n\n> @dsjoerg most jQuery based packages as this one should be initialized after all the required libraries are loaded, i.e. jQuery itself. That only happen in the `onRendered()` template event. So if you put the initialization code anywhere else it will not find the jQuery library and will raise an error.\n> Meteor best practice dictates that you shouldn't put code like that in the template files, those should only contain basic logic primarily dealing with displaying data. Good thing that you refactored the code from the template file. :+1: \n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/tsega/meteor-bootstrap3-datetimepicker/issues/47#issuecomment-145582011"}}