Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a date picker to a JetStrap page (Twitter Bootstrap)

Just started using JetStrap tonight to build some very basic entry forms. Lots of cool tools and fields, but no date picker. (Check it out if you haven't!) Other topics discuss this being done with Twitter Bootstrap, but not very directly...

Can I extend the libraries / controls available in the JetStrap page by pulling in from other web sources (a Google hosted library for example) to add in additional functionality? I'm very new to web front end work and would like to do as much work in JetStrap as possible without having to download the code locally and set up my own local IIS site.

like image 740
Shrout1 Avatar asked Oct 21 '22 09:10

Shrout1


1 Answers

I am one of the creators of Jetstrap.

We will be adding an easy external JS/CSS feature very soon, but in the mean time, you can load the script dynamically with javascript in the JS editor:

$(function() {
    $.getScript('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js', function() {
        $('.datepicker').datepicker();
    });
})

And in the markup you can add:

<input type="text" value="02-16-2012" class="datepicker">
like image 70
Max Avatar answered Oct 24 '22 04:10

Max