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

六月ゝ 毕业季﹏ 提交于 2019-12-07 05:46:07

问题


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.


回答1:


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">


来源:https://stackoverflow.com/questions/16661440/add-a-date-picker-to-a-jetstrap-page-twitter-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!