twitter bootstrap - using a datepicker with meteor -
twitter bootstrap - using a datepicker with meteor -
i've been trying day datepicker working in meteor app. there few questions here none of them seem provide total answer. got 1 installed without causing errors next this-
ok, got working manually using bootstrap-datepicker.js , datepicker.css http://www.eyecon.ro/bootstrap-datepicker/ , dropping these files client folder. used markup mentioned in page along next template helper:
template.templatename.rendered = function() { $('#datepicker').datepicker(); } no matter info set in template couldn't working tried reply template helper-
template.datepicker.events ({ 'focus #datepicker': function () { $('#datepicker').datepicker({ format: 'm dd, yyyy', autoclose: true }) console.log('#datepicker has focus'); } }); still nil blank input field. current html template-
<template name="datepicker"> <div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy"> <input id="datepicker" class="span2" size="16" type="text" value="12-02-2012"> <span class="add-on"><i class="icon-th"></i></span> </div> </template> i suspect problem understanding datepicker returning template.
the problem seems never tell datepicker 'show'. you're putting initialization code within of 'focus' event should telling show. example, try:
template.datepicker.rendered = function() { // initialize datepicker $('#datepicker').datepicker({ format: 'm, dd, yyyy' }); }; template.datepicker.events ({ 'focus #datepicker': function () { // show datepicker $('#datepicker').datepicker('show'); console.log('#datepicker has focus'); } }); alternatively, datetimepicker package works me.
twitter-bootstrap meteor
Comments
Post a Comment