JIRA 사용자 정의 필드 플러그인을 만들고 아래 링크에서 'datetime picker'컨트롤을 'monthyear picker'로 사용하고 싶습니다. http://jquerybyexample.blogspot.com/2012/06/show-only-month-and-year-in-jquery-ui.html속도 템플릿 (jira 사용자 정의 필드 플러그인)에서 jquery control datetimepicker를 사용할 수 없습니다.
JIRA 버전은 속도 템플릿 '5.2.11'
JQUERY 제어 물건 :
<script type="text/javascript">
alert("Handler for .click() called."); //get alert
AJS.$("#target").click(function() { //get alert while click on below "target" div.
alert("Handler for .click() called.");
});
AJS.$(document).ready(function() {
AJS.$('#txtDate').datepicker({ //shows javascript error as"[object Object] has no method 'datepicker' "
changeMonth: true,
changeYear: true,
dateFormat: 'MM yy',
onClose: function() {
var iMonth = AJS.$("#ui-datepicker-div .ui-datepicker-month :selected").val();
var iYear = AJS.$("#ui-datepicker-div .ui-datepicker-year :selected").val();
AJS.$(this).datepicker('setDate', new Date(iYear, iMonth, 1));
},
beforeShow: function() {
if ((selDate = AJS.$(this).val()).length > 0) {
iYear = selDate.substring(selDate.length - 4, selDate.length);
iMonth = jQuery.inArray(selDate.substring(0, selDate.length - 5), AJS.$(this).datepicker('option', 'monthNames'));
AJS.$(this).datepicker('option', 'defaultDate', new Date(iYear, iMonth, 1));
AJS.$(this).datepicker('setDate', new Date(iYear, iMonth, 1));
}
}
});
});
alert('final'); // not alert as error at above code
</script>
말한다 자바 스크립트 오류가 아래로 :
"TypeError: Object [object Object] has no method 'datepicker' [
http://localhost:2990/jira/s/en_US1rk3us/787/3/1/_/download/superbatch/js/batch.js:9919
"
어떤 생각, 내가 어떻게 사용자 정의 필드 - 속도 템플릿에이 컨트롤을 사용할 수 있고 작동합니까? 파일 system-webresources-plugin.xml
을 편집 할 수
내가 업데이트 한 XML 파일과 속도 템플릿에서 JS 파일을 inlcuding 제거하지만 여전히 날 같은 오류 "를"제공 형식 오류 : 직접 jQuery를 사용해보십시오 객체 [개체 개체] 'datepicker'[http : // localhost : 2990/jira/s/en_US1rk3us/787/3/1/_/다운로드/superbatch/js/batch.js : 9919'] 메서드가 없습니다. – dsi
답변 됨 updated.Batch.js에있는 그 링크 – Kuf
, 그냥 batch.js의 팝업 방법의 마지막 줄. 심지어 여기, datepicker 첫 번째 객체가 없습니다 .. 그래서, JS를 사용할 수 없습니다. stil ... – dsi