jquery-ui弹框问题($('#editdetaildiv').dialog('open')第二次不弹框)问题解决给分结贴
魔鬼_ 2015-08-19 05:31:40 我的一个list.jsp文件引入了如下内容:
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-ui-1.8.18.custom.min.js"></script>
<link rel="stylesheet" href="${pageContext.servletContext.contextPath }/css/jquery-ui-1.8.18.custom.css">
<link rel="stylesheet" href="${pageContext.servletContext.contextPath }/notebook/notebook_files/bootstrap.css">
<link rel="stylesheet" href="${pageContext.servletContext.contextPath }/js/ZebraDatepicker/public/default.css">
<link rel="stylesheet" href="${pageContext.servletContext.contextPath }/js/ZebraDatepicker/public/reset.css">
<link rel="stylesheet" href="${pageContext.servletContext.contextPath }/js/ZebraDatepicker/public/style.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ZebraDatepicker/core.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ZebraDatepicker/zebra_datepicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/businessmana/confirmationmana/list.js"></script>
其中此list.jsp文件中有一个div用来做弹出框用的代码如下(crazy标签是自定义的这个没有问题):
<div id="editdetaildiv" >
<table>
<tr>
<td>货物名称:</td><td><crazy:dictselect id="cargoname" name="cargoname" collection="${showcargoinfos}" ></crazy:dictselect></td>
</tr>
<tr>
<td>货物数量:</td><td> <input id="cargocount" name="cargocount" /> </td>
</tr>
<tr>
<td>货物重量:</td><td><input id="cargoweight" name="cargoweight" type="text"/> </td>
</tr>
<tr>
<td>数量单位:</td><td><crazy:dictselect id="showcountorginfos" name="showcountorginfos" collection="${showcountorginfos }"/></td>
</tr>
<tr>
<td>含 菌 数 :</td><td> <input id="funguscount" name="funguscount" type="text" /> </td>
</tr>
<tr>
<td>要求剂量 :</td><td> <input id="reqreagent" name="reqreagent" type="text" /> </td>
</tr>
<tr>
<td>辐照方式 :</td><td><crazy:dictselect id="irradtypes" name="irradtypes" collection="${irradtypes }"/></td>
</tr>
<tr>
<td>辐照时间 :</td><td> <input id="irradtime" name="irradtime" type="text" /> </td>
</tr>
<tr>
<td>时间单位 :</td><td> <crazy:dictselect id="timeorgs" name="timeorgs" collection="${timeorgs }"/> </td>
</tr>
<tr>
<td>备注信息:</td><td><crazy:dictselect id="irradflags" name="irradflags" collection="${irradflags }"/></td>
</tr>
<tr>
<td>其他说明:</td><td> <input id="irradflag" name="irradflag" type="text" /> </td>
</tr>
</table>
</div>
list.js这个文件部分代码如下(关于弹出框的):
这个是定义:
$("#editdetaildiv").dialog({
autoOpen : false,// 设置对话框打开的方式 不是自动打开
show : "bind",
hide : "explode",
modal : true,
height : 500,
width : 450,
buttons : {
'保存' : function() {
saveEditdetailInfo();
$(this).dialog("close");
},
"取消" : function() {
$(this).dialog("close");
}
},
open : function(ev, ui) {
initEditConfirmInfo();
// CommnUtil.cleanInputValue("addcargoname,org,irradtype,irradtime,timeorg");
},
close : function(ev, ui) {
//CommnUtil.cleanInputValue("cargoname,cargocount,cargoweight,showcountorginfos,funguscount,reqreagent,irradtypes,irradtime,timeorgs,irradflags,irradflag");
}
});
单击jsp中的一个按钮触发的弹框代码:
function processeditdetail(){
if(CommnUtil.isHaveSelectOneCheckbox("confirmsDetailcheck")){
alert("processeditdetail");
$('#editdetaildiv').dialog('open');
}else{
alert("请选择而且只能选择一条详情记录!");
}
}
我的问题如下:
第一次进入list.jsp页面单击写好的触发弹框按钮没有任何问题。弹框正常,但是换到其他页面在回到list.jsp这个页面在此单击触发弹框的按钮,页面不会弹出对话框,这行代码:
alert("processeditdetail");能正常执行,
但是$('#editdetaildiv').dialog('open');这行代码没有反应。
万能的吧友,求解脱。。。