废话不多说,直接上代码:

@model Huacisoft.Model.Crm_Sys_Role
@{
Layout = null; } <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色管理</title>
<!--前后台公用样式开始-->
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Themes/Default/Common.css")" />
<!--前后台公用样式结束--> <!--后台样式开始-->
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Themes/Default/Admin.css")" />
<!--后台样式结束--> <!--EasyUI引用开始-->
<link rel="stylesheet" type="text/css" href="@Url.Content("~/js/jquery-easyui-1.3.5/themes/default/easyui.css")" />
<link rel="stylesheet" type="text/css" href="@Url.Content("~/js/jquery-easyui-1.3.5/themes/icon.css")" />
<script type="text/javascript" src="@Url.Content("~/js/jquery-1.8.0.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/js/jquery-easyui-1.3.5/jquery.easyui.min.js")"></script>
<script type="text/javascript" src='@Url.Content("~/Js/jquery-easyui-1.3.5/locale/easyui-lang-" + ViewBag.Language + ".js")'></script>
<!--EasyUI引用结束--> <!--前后台公用脚本封装开始-->
<script type="text/javascript" src="@Url.Content("~/js/common.js")"></script>
<script type="text/javascript" src="@Url.Content("~/js/dialog.js")"></script>
<!--前后台公用脚本封装结束--> <style type="text/css">
.ItemTitle{background-image:url(../images/rolesBg.png);height:26px; padding-left:10px; line-height:26px; vertical-align:middle; font-weight:bold;}
.ItemTitle input{ position: absolute; margin-top: 6px;*margin-top: -3px;}
.ItemList{margin-top:10px; margin-bottom:15px;}
.ItemList input{ margin-left:10px;}
.theName{float:left; margin-top:-1px;*margin-top: 3px; padding-left:3px; padding-bottom:8px; } </style> <script type="text/javascript">
function FormatData(value) {//value, row, index
//-1:不显示checkbox 0:没有该方法 1:没有该方法权限 2:有该方法权限 style='margin-left: 30%;'
var newData = "";
// if (data == -1) {
// newData = ' '
// }
if (value.split(',')[0] == "-1") {
newData = "<div >" + '<input title="该模块暂无此方法,请去模块管理页面核对!" id="' +value.split(',')[1] + '" type="checkbox" disabled="disabled" />' + "</div>"
}
if (value.split(',')[0] == "0") {
newData = "<div >" + '<input id="' + value.split(',')[1] + '" type="checkbox" />' + "</div>"
}
if (value.split(',')[0] =="1") {
newData = "<div >" + '<input id="' + value.split(',')[1] + '" type="checkbox" checked="checked" />' + "</div>"
} return newData;
}
$(function () {
var cols = new Array(); var col1 = {};
col1["field"] = "Module_Id";
col1["title"] = "模块";
col1["width"] = 130;
col1["hidden"] = true;
cols.push(col1); var col2 = {};
col2["field"] = "Module_Name";
col2["title"] = "模块";
col2["width"] = 60;
col2["align"] = "left";
cols.push(col2); $.ajax({
url: '@Url.Action("LoadFunctionTitle", "System")',
async: false,
type: "POST",
dataType: 'json',
success: function (json) {
var rows = json.rows;
for (var i = 0; i < rows.length; i++) {
var col = {};
col["field"] = rows[i].Function_EnglishName;
col["title"] = rows[i].Funtion_Name;
col["width"] = 30;
col["align"] = "center";
col["formatter"] = function (value,row) {return FormatData(value);};
cols.push(col);
//"{ field: '" + rows.Function_EnglishName + "', title: '" + rows[i].Funtion_Name + "', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) {return FormatData(value);}}";
}
},
error: function (a, b, c) {
$.messager.alert("@ViewBag.SystemInfo", "@ViewBag.Fail", 'warning');
}
}); $('#DomainTable').treegrid({
url: '@Url.Action("LoadModuleForRole", "System")' + "?roleId=@ViewBag.RoleId",
iconCls: 'icon-ok',
width: "90%",
height: 650,
rownumbers: false,
nowrap: false,
animate: true,
fitColumns: true,
idField: 'Module_Id',
treeField: 'Module_Name',
pagination: true,
rowStyler: function (row) {
if (row.persons > 1) {
return 'background:#AAD684;color:#fff';
}
},
singleSelect: true,
//frozenColumns: [[{ field: 'ck', checkbox: true}]],
// frozenColumns: [[{ field: 'ck', width: 40, formatter: function (value, row, index) {
// return '<input type="radio" name="rd_action" />';
// }
// }]],
//queryParams: getQueryParams("search_go"),
columns: [cols],
// columns: [[
// { field: 'Module_Id', title: 'Module_Id', width: 60, sortable: true, hidden: true },
// { field: 'Module_Name', title: '@ViewBag.ModuleName', width: 60, sortable: true },
// { field: 'Search', title: '@ViewBag.Search', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Create', title: '@ViewBag.Add', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) {
// //alert(FormatData(data));
// return FormatData(value);
// }
// },
// { field: 'Edit', title: '@ViewBag.Edit', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Delete', title: '@ViewBag.Delete', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Import', title: '@ViewBag.Import', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Export', title: '@ViewBag.Export', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Sync', title: '@ViewBag.Sync', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) { // return FormatData(value);
// }
// },
// { field: 'Print', title: '@ViewBag.Print', width: 30, align: 'center', editor: 'text', sortable: true, formatter: function (value, row, index) {
// return FormatData(value);
// }
// }
// ]],
onBeforeLoad: function (row, param) {
//移除头部批量勾选框
$(".datagrid-header-check input").css("visibility", "hidden");
//隐藏分页
$(".datagrid-pager").css("display", "none");
//$(".datagrid-pager").removeClass("datagrid-pager");
return true;
},
onBeforeExpand: function (row) {
if (row != null) {
//动态设置展开查询的url
var url = '@Url.Action("LoadRole", "Role")' + "?roleId=" + row.Role_Id;
$("#DomainTable").treegrid("options").url = url;
}
return true;
},
onLoadSuccess: function (row, data) {
if (data.rows.length == 0) {
$(".datagrid-view2 .datagrid-body").html("<div class='divNodataHeigth'>@ViewBag.NoData</div>");
}
}, onClickRow: function (row) {
$("input[name=rd_action]", $("div.datagrid-view1 tr.datagrid-row-selected")).attr("checked", "checked");
} }); });
</script>
<script type="text/javascript">
$(function () {
$("#Cancel").click(function(){
window.location.href='@Url.Content("Index")';
});
$("#Save").click(function () {
var itemList = new Array();
$("#configDiv > div").find("input[type='checkbox']").each(function () {
if ($(this).attr("checked")) {
itemList.push($(this).attr("id"));
}
}) var itemAll = itemList.join(",");
// alert(itemAll);
$.ajax({
url: '@Url.Content("~/Role/Save")',
async: false,
type: "POST",
dataType: 'text',
data: { roleId: "@ViewBag.RoleId", funList: itemAll },
success: function (msg) {
if (msg == "True") {
$.messager.alert("@ViewBag.SystemInfo", "@ViewBag.Success", 'warning');
window.location.href="@Url.Content("~/Role/Index")";
}
else {
$.messager.alert("@ViewBag.SystemInfo", "@ViewBag.Fail", 'warning');
}
},
error: function (msg) {
$.messager.alert("@ViewBag.SystemInfo", "@ViewBag.Fail", 'warning');
}
});
});
})
</script> </head>
<body> <div class=""> <!--wrap class="header" div end --> <h3 class="h3Box"><span></span>权限配置</h3>
@Html.TextBoxFor(m => m.Role_Id, new { style = "display:none" })
<div class="">
<div id="data" style="margin-top:10px;">
<div id="configDiv">
<table id="DomainTable">
</table> </div>
<div>@ViewBag.CustomFieldTip</div>
</div> <div class="ct" style=" text-align:center">
<div class="btnCenterBoxes">
<div class="classdetail_btn_box0101" id="divSubmit">
<span class="classdetail_btn_box0102" id="Save">@ViewBag.Save</span>
</div>
</div>
<div class="btnCenterBoxes">
<div class="classdetail_btn_box0101" id="divCancel">
<span class="classdetail_btn_box0102" id="Cancel">@ViewBag.Back</span>
</div>
</div>
@*<span id="Save" class="btnSpan btnBlue01 colorTextBlue btnText2">@ViewBag.Save</span> <a class="btnSpan btnBlue01 colorTextBlue btnText2" href="@Url.Content("Index")"><span id="Cancel" >@ViewBag.Back</span></a>*@ </div> </div>
</div>
<div id="divProcess" style=" display:none">
<div class="" style="position:absolute;width:100%;height:2040px;background:#b8b8b8;top:0;bottom:0;right:0;left:0; opacity: 0.5;filter:alpha(opacity=50)" >
</div>
<div class="iconMsg" style="position:absolute;top:1000px;left:44%;z-index:9999;line-height:30px;">
<p>@ViewBag.Submit...</p>
</div>
</div>
</body> </html>

asp.mvc + easyui 动态列的更多相关文章

  1. easyui 动态列

    $.post('${createLink(action:"build Columns url ")}', params, function(data){ var columns = ...

  2. MVC+EasyUI 菜单导航的实现

    一个简单的使用mvc+easyUi 动态菜单显示 直接上代码 前端 function initMenu() { $.get("/Admin/Home/GetNav", functi ...

  3. Easy DataGrid 实现动态列、行

    Easy DataGrid 实现动态列.行 前端代码: <title>展示销售的实时数据</title> <script type="text/javascri ...

  4. ASP.NET MVC+EasyUI+Entity FrameWork 整合开发

    本文详细讲解怎么用ASP.NET MVC+EasyUI+Entity FrameWork 来开发一个项目 对于ASP.NET MVC的Jscript库,主要引用 <script type=.mi ...

  5. ASP.NET MVC +EasyUI 权限设计(二)环境搭建

    请注明转载地址:http://www.cnblogs.com/arhat 今天突然发现博客园出问题了,老魏使用了PC,手机,平板都访问博客园了,都是不能正常的访问,原因是不能加载CSS,也就是不能访问 ...

  6. ASP.NET MVC +EasyUI 权限设计(一)开篇

    在前一段时间中,老魏的确非常的忙碌,Blog基本上没有更新了,非常的抱歉,那么在后面的时间中,老魏会尽量的抽时间来写的,可能时间上就不太富裕了.今天开始呢,老魏会和大家分享一下关于权限设计的有关文章, ...

  7. [ASP.NET MVC] 利用动态注入HTML的方式来设计复杂页面

    原文:[ASP.NET MVC] 利用动态注入HTML的方式来设计复杂页面 随着最终用户对用户体验需求的不断提高,实际上我们很多情况下已经在按照桌面应用的标准来设计Web应用,甚至很多Web页面本身就 ...

  8. 对Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架的个人认识

    对Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架的个人认识   初次接触Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架,查阅了相 ...

  9. Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架

    Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架 初次接触Spring.Net+NHibenate+Asp.Net Mvc+Easyui框架,查阅了相关资料,了解了框 ...

随机推荐

  1. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  2. 一个免费的、跨平台的、开源音频编辑器Audacity

    Audacity 是一个免费的开源程序,用于编辑音频录制.它可在多个平台(windows/linux)上运行.Audacity 基于 GUI,是一个具有多种选项的强大程序.它支持您录制各种类型的声音. ...

  3. Web性能优化:What? Why? How?

    为什么要提升web性能? Web性能黄金准则:只有10%~20%的最终用户响应时间花在了下载html文档上,其余的80%~90%时间花在了下载页面组件上. web性能对于用户体验有及其重要的影响,根据 ...

  4. 三分钟学会用 js + css3 打造酷炫3D相册

    之前发过该文,后来不知怎么回事不见了,现在重新发一下. 中秋主题的3D旋转相册 如图,这是通过Javascript和css3来实现的.整个案例只有不到80行代码,我希望通过这个案例,让正处于迷茫期的j ...

  5. bcp 命令实例

    set sql_flow="select Id,',',ApplierName,',',FlowStatus,',',IsApproved,',',CreateTime from *** w ...

  6. javascript运动系列第一篇——匀速运动

    × 目录 [1]简单运动 [2]定时器管理 [3]分享到效果[4]移入移出[5]运动函数[6]透明度[7]多值[8]多物体[9]回调[10]函数完善[11]最终函数 前面的话 除了拖拽以外,运动也是j ...

  7. Node.js npm 详解

    一.npm简介 安装npm请阅读我之前的文章Hello Node中npm安装那一部分,不过只介绍了linux平台,如果是其它平台,有前辈写了更加详细的介绍. npm的全称:Node Package M ...

  8. VS2015常用快捷键总结

    生成解决方案 F6,生成项目Shift+F6 调试执行F5,终止调试执行Shift+F5 执行调试Ctrl+F5 查找下一个F3,查找上一个Shift+F3 附加到进程Ctrl+Alt+P,逐过程F1 ...

  9. SuperMap-iServer-单点登录功能验证(CAS)

    SuperMap-iServer-单点登录功能验证(CAS) 1.测试目的: 验证SuperMap-iServer使用CAS单点登录的功能是否正常. 2.测试环境: SuperMap-iServer8 ...

  10. 热修复-Tinker

    微信开源,真是喜出望外,必须要去看看啊,比起nuwa来微信好很多,而且github上也有专门的官方文档说明,还有很多资料查询 参考地址:https://github.com/Tencent/tinke ...