框架-弹出选择框(传编号名称)
弹出选择框
1.显示页面(列表页)Jquery方法
//选择课件CorrespondingA
$("body").on("click", "#btnCourseware", function() {
var sUrlParam = "&selectcourseware=1";
var dlgParam = {
title: "选择课件",
close: function() {
if (art.dialog.data("RetStatus") == 101) {
var retValue = art.dialog.data("RetValue").split("^");
$("#CoursewareCode").val(retValue[0]);
$("#CorrespondingA").val(retValue[1]);
}
}
};
$.asAppModalDialog("CourseWare", sUrlParam, dlgParam);
});
2.显示页面(列表页)选择按钮【主从表用得到,不是主从表可直接参照第3部】
<td class="w200">@Html.Raw(HtmlControlHelper.GetText("CorrespondingA", "", 30, false, false))
<button type="button" class="positive" name="save" id="btnCourseware">选择课件</button></td>
3.显示页面(详细页)选择按钮
<td class="w200">@Html.Raw(HtmlControlHelper.GetText("CorrespondingA", dataRow["CorrespondingA"].ToString(), 30, false, false))
@Html.Raw(HtmlControlHelper.GetHidden("CoursewareCode", DbService.DtV(curMainDataTable, "CoursewareCode")))
<button type="button" class="positive" name="save" id="btnCourseware">选择课件</button>
</td>
4.需要选择的页面新增
//传递显示页面方法中的参数
String mSure = RequestHelper.GetQueryString("selectcourseware", "0");
5.需要选择的页面增加弹框方法以及弹框调取方法(这个放页面顶部)
//弹框方法
$("body").on("click", "#btnselectcourseware", function() {
var info = $.asGetValuesOfCtrlName("gridform_myTable", "gridSel", "|");
//异步取得学生的信息
var formData = {};
formData.StudentCodes = info;
formData.TableName = "TrainErp_Teach_Courseware";
formData.Columns = "CoursewareCode ,CoursewareName";
formData.StudentCode = "CoursewareCode";
var sysAjaxUrl = "/manage/Popup/GetPopup";
var retInfoCheck = sysDoAjaxPost(sysAjaxUrl, formData);
if (retInfoCheck.RetStatus == 400) {
art.dialog.data("RetStatus", "101");
art.dialog.data("RetValue", retInfoCheck.RetValue);
art.dialog.close();
} else {
art.dialog.close();
}
});
//弹框调用方法
<script type="text/javascript">
function sysDoAjaxPost(ajaxUrl, paramInfo) {
var retData = "";
$.ajax({
url: ajaxUrl,
type: "POST",
async: false,
data: paramInfo,
cache: false,
success: function (responseText) {
retData = responseText;
}
});
return retData;
}
</script>
6.需要选择的页面增加操作【权限管理里肯定也要增加一个操作参数】
if (mSure == "0")
{
if (AppService.CheckRoleModuleParam(sysRoleModuleParamList, "add", "1", ref sysRoleModuleParam))
{
<button type="button" id="btn@(sysRoleModuleParam.ParamCode)" class="@sysRoleModuleParam.ParamCode">@sysRoleModuleParam.ModuleParam.ParamName</button>
}
if (AppService.CheckRoleModuleParam(sysRoleModuleParamList, "modify", "1", ref sysRoleModuleParam))
{
<button type="button" id="btn@(sysRoleModuleParam.ParamCode)" class="@sysRoleModuleParam.ParamCode">@sysRoleModuleParam.ModuleParam.ParamName</button>
}
if (AppService.CheckRoleModuleParam(sysRoleModuleParamList, "delete", "1", ref sysRoleModuleParam))
{
<button type="button" id="btn@(sysRoleModuleParam.ParamCode)" class="@sysRoleModuleParam.ParamCode">@sysRoleModuleParam.ModuleParam.ParamName</button>
}
}
else
{
if (AppService.CheckRoleModuleParam(sysRoleModuleParamList, "selectcourseware", "1", ref sysRoleModuleParam))
{
<button type="button" id="btn@(sysRoleModuleParam.ParamCode)" class="@sysRoleModuleParam.ParamCode">@sysRoleModuleParam.ModuleParam.ParamName</button>
}
}