Мне не удается получить JQuery Datepicker, работающий в моем приложении Grails 2.4.4. С плагином jquery-UI или без него он не работает. Разве это не тот случай, когда компоненты пользовательского интерфейса интегрированы в последний плагин jquery, поскольку это jQuery 1.11? Как добавить датупиксера?grails 2.4.4 jquery datepicker
У меня есть этот код:
BuildConfig.groovy:
...
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:2.1.3"
compile ":mail:1.0.7"
build ':tomcat:7.0.54'
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":jquery:1.11.1"
//compile ":jquery-ui:1.10.4"
application.js
//= require jquery
//= require_tree .
//= require_self
if (typeof jQuery !== 'undefined') {
(function($) {
$('#spinner').ajaxStart(function() {
$(this).fadeIn();
}).ajaxStop(function() {
$(this).fadeOut();
});
})(jQuery);
}
create.gsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="layout" content="main" />
<title>Create</title>
</head>
<body>
<g:javascript library="jquery" plugin="jquery"/>
<%-- <jq:resource bundle="ui" components="datepicker" /> Gives a nullpointer exception!!!--%>
<script type="text/javascript">
$(document).ready(function()
{
$("#install").datepicker({dateFormat: 'yyyy/mm/dd'});
})
</script>
<div class="body">
...
<input name="install" id="install" value="${fieldValue(bean:blaBlubInstance,field:'install')}"/>
Нет сожаления. Я получаю эту ошибку в chrome: 'Uncaught TypeError: undefined не является функцией' в этой строке: ' $ ("# install"). Datepicker ({dateFormat: 'yyyy/mm/dd'}); ' – BioBier
@ BioBer, вы включаете свои приложения.js и application.css в основной макет? –