Jquery ui Grails2.4.4中的jQueryUI插件,使用资产管道添加日期选择器
为了使用Grails2.4.4中的jQueryUI插件和资产管道,我应该执行哪些步骤 我所做的是: 我补充说Jquery ui Grails2.4.4中的jQueryUI插件,使用资产管道添加日期选择器,jquery-ui,grails,asset-pipeline,grails-plugin,Jquery Ui,Grails,Asset Pipeline,Grails Plugin,为了使用Grails2.4.4中的jQueryUI插件和资产管道,我应该执行哪些步骤 我所做的是: 我补充说 compile "org.grails.plugins:jquery-ui:1.10.4" 在BuildConfig.groovy中 还增加了: //= require jquery-ui/js/jquery-ui-1.10.4.custom.min //= require js/jquery-ui-1.10.4.custom 在application.js中 及 在applicat
compile "org.grails.plugins:jquery-ui:1.10.4"
在BuildConfig.groovy中
还增加了:
//= require jquery-ui/js/jquery-ui-1.10.4.custom.min
//= require js/jquery-ui-1.10.4.custom
在application.js中
及
在application.css中
我已在gsp页面中添加了所需的脚本:
<script type="text/javascript">
$(document).ready(function()
{
$("#datepicker").datepicker({dateFormat: 'yy/mm/dd'});
})
</script>
$(文档).ready(函数()
{
$(“#datepicker”).datepicker({dateFormat:'yy/mm/dd'});
})
我想做的是在普惠制中增加一个日期选择器。我还应该做些什么才能让它发挥作用
根据建议,我已检查了视图源:
内封头:
<link rel="stylesheet" href="/NTSuite_Web/assets/application.css?compile=false">
<link rel="stylesheet" href="/NTSuite_Web/assets/bootstrap.css?compile=false">
<link rel="stylesheet" href="/NTSuite_Web/assets/themes/ui-lightness/jquery-ui-1.10.4.custom.css?compile=false">
<script type="text/javascript">
$(document).ready(function()
{
$("#datepicker").datepicker({dateFormat: 'yy/mm/dd'});
})
</script>
<script type="text/javascript">
function doSubmit(val){
document.getElementById('openMode').value=val;
document.party.submit();
}
</script>
$(文档).ready(函数()
{
$(“#datepicker”).datepicker({dateFormat:'yy/mm/dd'});
})
函数doSubmit(val){
document.getElementById('openMode')。value=val;
document.party.submit();
}
在正文中:
<script src="/NTSuite_Web/assets/jquery/jquery-1.11.1.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/jquery.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/application.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-affix.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-alert.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-button.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-carousel.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-collapse.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-dropdown.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-modal.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-tooltip.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-popover.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-scrollspy.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap-tab.js?compile=false" type="text/javascript"></script><script src="/NTSuite_Web/assets/bootstrap-transition.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/bootstrap.js?compile=false" type="text/javascript"></script>
<script src="/NTSuite_Web/assets/js/jquery-ui-1.10.4.custom.js?compile=false" type="text/javascript"></script>
我的约会选择者:
<input type="text" id="datepicker">
我做这一切都不了解整个过程,如果我能用正确的程序得到答案,那就太棒了 一,。不要查看源代码2。您是否看到jQueryUI i的html源代码3。您的开发控制台在调用datepicker时会说什么错误/问题?您需要学习调查您拥有jquery-1.11.1.js,然后在它的正下方再次使用jquery-可能会有冲突-首先删除定义的第二个。开发者控制台是chrome上的F12,然后单击控制台并在单击页面时查看日志,以查看java脚本是否返回错误。至于jQueryUI和datepicker。jQueryUI本身做很多事情,所以您需要首先确定是否加载了jQueryUI。首先检查这个,然后如果这些都已加载,并且您的浏览器控制台检查是否有任何错误,因此jquery ui附带jquery-ui.min.css,我看不到您的内容,包括您的css详细信息。我想建议一件事。就我个人而言,我几乎从不为jQueryUIBootstrap之类的插件操心。如果我想包含其他jquery脚本,我需要做什么?。(即,将css和js文件包含在grails app/assets/javascripts样式表中,然后在application.css和application.js中声明每个文件夹中的两个核心文件,以添加新的css/js样式。如果5分钟后我无法使其工作,我将这样做。在大多数情况下,这些问题都与此相关对基础知识不太了解。通常,在声明核心JS文件时,它们往往位于最顶端。例如,jquery和jquery ui位于最顶端,然后是引导等。错误的顺序可能会产生不利影响。我建议您快速查看一下,您会看到jquery ui就在jquery下-与您的一样在底部,您在没有首先测试初始值的情况下,已经走得很远了。您声称jquery datepicker不工作,同时看起来您也在引导中加载…-Boostrap也有自己的datepicker。请尝试放慢速度,用jquery单独测试jquery-ui,然后继续解决该特定问题
<input type="text" id="datepicker">