我想在我的一个文本输入中使用jQuery UI datepicker.这个是一个对话模式.
事实上,我可以在正常的文档文本输入中调用datepicker,并且我正常地得到了我的日历,但我不能在对话模式文本输入中做到这一点(在模态文本输入内部克隆之后我没有任何JavaScript错误).
这是我调用datepicker的代码:
$(function() {
$("#MytextInputID").datepicker({ dateFormat: 'dd/mm/yy' });
);
Run Code Online (Sandbox Code Playgroud)
我试过更改css .ui-datepicker Z-index属性,但我什么都没有.
你有解决这个问题的技巧吗?
问候,
在my_page.html我有
function openSaisieARModal()
{
window_select_CodeAgence = new showModalWindow('SaisieARModal', 500);
}
我使用这个脚本
var showModalWindow=function(id, width)
{
var newId=id+'Copy';
this.id=newId;
var previousNode=document.getElementById(newId);
if(previousNode!=null)
{
previousNode.parentNode.removeChild(previousNode);
}
var rootNode=document.getElementsByTagName('body')[0];
this.node=document.createElement("div");
rootNode.appendChild(this.node);
this.node.setAttribute('id', newId);
this.node.setAttribute('title', document.getElementById(id).getAttribute('title'));
this.node.innerHTML=document.getElementById(id).innerHTML;
if(width==null)
{
width=400;
}
$('#'+newId).dialog({autoOpen: true, modal: true, width:width });
this.closeWindow=function()
{
$('#'+this.id).dialog('close');
}
this.centerContent=function()
{
this.node.style.textAlign='center';
}
this.center=function()
{
$('#'+this.id).dialog('option', 'position', 'center');
}
Run Code Online (Sandbox Code Playgroud)
}
这是my_page.html中的模态HTML代码
<div style="display:none;">
<div id="SaisieARModal" …
Run Code Online (Sandbox Code Playgroud)Run Code Online (Sandbox Code Playgroud)