简体   繁体   English

加载小部件时单击日期选择器不显示

[英]Datepicker not displaying on click when widget loaded

I have 3 datepickers on the screen (start, end, due date), all 3 have an icon and text box which show a datepicker when either icon or text box is clicked.我在屏幕上有 3 个日期选择器(开始、结束、截止日期),所有 3 个都有一个图标和文本框,当单击图标或文本框时会显示一个日期选择器。 When i have a stopwatch widget running on the screen clicking any of the text boxes will load datepicker, but clicking any of the icons won't.当我在屏幕上运行秒表小部件时,单击任何文本框将加载日期选择器,但单击任何图标都不会。 If i get the date picker to appear by clicking on the text box;如果我通过单击文本框来显示日期选择器; all 3 date picker icons will start to work.所有 3 个日期选择器图标都将开始工作。

$("#StartDate").datepicker("show"); $("#StartDate").datepicker("show"); works, but doesn't work when the stopwatch widget is loaded, but works if any datepicker is loaded by clicking a text box (ie: load due date datepicker by clicking the text box, afterwards i can click the start date icon and date picker will show).工作,但在加载秒表小部件时不起作用,但如果通过单击文本框加载任何日期选择器则工作(即:通过单击文本框加载到期日期选择器,之后我可以单击开始日期图标和日期选择器将会呈现)。

$("#DueDate").datepicker({
showButtonPanel: false,
showOn: 'both',
buttonImage: $Url.resolve("~/Content/Images/calendar-small.png"),
buttonText: "Select date",
onSelect: function (dateText) {
changeInput();
var inp = $(this).parents('.step-input-element');
inp.find('.clear-datepicker').show();
inp.removeClass('date-cleared')
$("#DueDate").datepicker("show");
}
});

it was a z-index issue.这是一个 z-index 问题。 When users click on the datepicker textarea or datepicker icon i would set the z-index to a higher value and the datepicker would appear.当用户单击 datepicker textarea 或 datepicker 图标时,我会将 z-index 设置为更高的值,并且 datepicker 会出现。

Clicking the stopwatch would set new z-index values for certain items, and the datepicker couldn't make it to the foreground because the other things had higher index values.单击秒表将为某些项目设置新的 z-index 值,并且 datepicker 无法将其置于前台,因为其他事物具有更高的索引值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM