62,046
社区成员
发帖
与我相关
我的任务
分享
<td class="tb_right">
<input id="LicenseType" type="text" class="LicenseType" style="width: 300px" maxlength="200"
readonly="True" onclick="SelLicense()" />
</td>
<div id="License" class="License" style="display: none;">
<table>
<tr>
<td>
<asp:Repeater ID="RepLicense" runat="server">
<ItemTemplate>
<input id="cbSel" class="cbSel" type="checkbox" value='<%#Eval("LicenseTypeName")%>' />
<%#Eval("LicenseTypeName")%>
</ItemTemplate>
</asp:Repeater>
</td>
<td>
<input id="SelectLi" class="SelectLi" type="button" style="color: red" value="选择"
onclick="cbSel()" />
</td>
</tr>
</table>
</div>
function SelLicense() {
$.setupJMPopups({
screenLockerBackground: "#003366",
screenLockerOpacity: "0.9"
});
$.openPopupLayer({
name: "License",
width: 300,
target: "License"
});
var check = $("#popupLayer_License .cbSel");
var scheduleId = $(".LicenseType").val();
if (scheduleId != "") {
var arr = scheduleId.split(";");
for (var i = 0; i < arr.length; i++) {
check.each(function(j) {
if (check[j].value == arr[i])
check[j].checked = true;
});
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex != -1)
{
HyperLink link = (HyperLink)e.Row.FindControl("HyperLink1");
string typeID = GridView1.DataKeys[e.Row.RowIndex]["TypeID"].ToString();
string typeName = e.Row.Cells[1].Text;
link.Attributes.Add("onclick", "GetValue(" + typeID + ",'" + typeName + "');");
link.Attributes["style"] = "Cursor:hand; text-decoration: underline; color: red;";
}
}
<script type="text/javascript">
function GetValue(TypeID, TypeName)
{
if(TypeID != null){
var TypeInfo = [TypeID,TypeName];
window.returnValue = TypeInfo;
window.close();
}
else
{
alert('请选择类型!');
}
}
</script>
$(function(){
$("#selecttype").bind("click",function(){
var userName = window.showModalDialog("A.aspx", "", "dialogHeight=450px, dialogWidth=110px, toolbar =no, menubar=no, scrollbars=1, resizable=0, location=no, status=no");
try
{
$("#TypeID").val(userName[0]);
$("#txtType").val(userName[1]);
}
catch(e){};
});
})