我有一个网格,我已经搜索了很长一段时间,试图找到一个解决方案,以便在网格有cellEdit:true时显示日期选择器。我发现的很多文章都说必须调整z-index,但这对我没有用。我试过在.htm head部分调整它,如下面的代码以及jqgrid的.css文件。如果我单击单元格没有任何反应,但如果我在另一个网页上单击并返回日期对话框,则会显示弹出窗口。即使在调整z指数后,它仍然隐藏什么?下面我已经把!重要的,所以希望这些信息不会被覆盖。 感谢。
<style type="text/css">
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; z-index: 2000 !important;}
</style>
==================================================
{name:'LOCK_EXPIRATION_DATE',index:'LOCK_EXPIRATION_DATE', width:80, width:90, sorttype:"date",align:'left',sortable:'true',editable:true,fixed:true, editoptions: { dataInit: function(el) { setTimeout(function() { $(el).datepicker(); }, 200); } },
==================================================
onSelectRow: function(id){ if(id && id!==lastsel3){ jQuery('#list4').jqGrid('restoreRow',lastsel3); jQuery('#list4').jqGrid('editRow',id,true,pickdates); lastsel3=id; } },
==================================================
cellEdit: true,
==================================================
答案 0 :(得分:0)
您可以在 datepicker 定义中添加属性,在其z-index
函数中定义日期选择器的dataInit
。而不是直接使用$(el).datepicker();
。这有助于在 jqGrid
$(el).datepicker({
beforeShow:function(input,inst){
setTimeout(function(){
$(".ui-datepicker").css("z-index", 2000);}, 10);
}
});