ylbtech-Code-NFine:下来框和复选框
1.返回顶部
1、
1.1 html
 $("#F_OrganizeId").bindSelect({
url: "/SystemManage/Organize/GetTreeSelectJson",
});

-

<select id="F_OrganizeId" name="F_OrganizeId" class="form-control required">
</select>
1.2 cs
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetTreeSelectJson()
{
var data = organizeApp.GetList();
var treeList = new List<TreeSelectModel>();
foreach (OrganizeEntity item in data)
{
TreeSelectModel treeModel = new TreeSelectModel();
treeModel.id = item.F_Id;
treeModel.text = item.F_FullName;
treeModel.parentId = item.F_ParentId;
treeModel.data = item;
treeList.Add(treeModel);
}
return Content(treeList.TreeSelectJson());
}
2、
2.1 html
 $("#F_Type").bindSelect({
url: "/SystemManage/ItemsData/GetSelectJson",
param: { enCode: "RoleType" }
});

-

<select id="F_Type" name="F_Type" class="form-control required">
</select>
2.2 cs
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSelectJson(string enCode)
{
var data = itemsDetailApp.GetItemList(enCode);
List<object> list = new List<object>();
foreach (ItemsDetailEntity item in data)
{
list.Add(new { id = item.F_ItemCode, text = item.F_ItemName });
}
return Content(list.ToJson());
}
3、
3.1 html
$("#permissionTree").treeview({
height: 444,
showcheck: true,
url: "/SystemManage/RoleAuthorize/GetPermissionTree",
param: { roleId: keyValue }
});

-

<div id="permissionTree"></div>
3.2 cs
public ActionResult GetPermissionTree(string roleId)
{
var moduledata = moduleApp.GetList();
var buttondata = moduleButtonApp.GetList();
var authorizedata = new List<RoleAuthorizeEntity>();
if (!string.IsNullOrEmpty(roleId))
{
authorizedata = roleAuthorizeApp.GetList(roleId);
}
var treeList = new List<TreeViewModel>();
foreach (ModuleEntity item in moduledata)
{
TreeViewModel tree = new TreeViewModel();
bool hasChildren = moduledata.Count(t => t.F_ParentId == item.F_Id) == ? false : true;
tree.id = item.F_Id;
tree.text = item.F_FullName;
tree.value = item.F_EnCode;
tree.parentId = item.F_ParentId;
tree.isexpand = true;
tree.complete = true;
tree.showcheck = true;
tree.checkstate = authorizedata.Count(t => t.F_ItemId == item.F_Id);
tree.hasChildren = true;
tree.img = item.F_Icon == "" ? "" : item.F_Icon;
treeList.Add(tree);
}
foreach (ModuleButtonEntity item in buttondata)
{
TreeViewModel tree = new TreeViewModel();
bool hasChildren = buttondata.Count(t => t.F_ParentId == item.F_Id) == ? false : true;
tree.id = item.F_Id;
tree.text = item.F_FullName;
tree.value = item.F_EnCode;
tree.parentId = item.F_ParentId == "" ? item.F_ModuleId : item.F_ParentId;
tree.isexpand = true;
tree.complete = true;
tree.showcheck = true;
tree.checkstate = authorizedata.Count(t => t.F_ItemId == item.F_Id);
tree.hasChildren = hasChildren;
tree.img = item.F_Icon == "" ? "" : item.F_Icon;
treeList.Add(tree);
}
return Content(treeList.TreeViewJson());
}
4、
5、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Code-NFine:下来框和复选框的更多相关文章

  1. Selenium2+python自动化19-单选框和复选框(radiobox、checkbox)

    本篇主要介绍单选框和复选框的操作 一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了 ...

  2. CSS学习笔记三:自定义单选框,复选框,开关

    一点一点学习CCS,这次学习了如何自定义单选框,复选框以及开关. 一.单选框 1.先写好body里面的样式,先写几个框 <body> <div class="radio-1 ...

  3. 自动化测试-15.selenium单选框与复选框状态判断

    本篇主要介绍单选框和复选框的操作 一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了 ...

  4. 2.12 单选框和复选框(radiobox、checkbox)

    2.12 单选框和复选框(radiobox.checkbox) 本篇主要介绍单选框和复选框的操作一.认识单选框和复选框    1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是 ...

  5. Selenium2学习(十五)-- 单选框和复选框(radiobox、checkbox)

    本篇主要介绍单选框和复选框的操作 一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了 ...

  6. Selenium2+python自动化19-单选框和复选框(radiobox、checkbox)【转载】

    本篇主要介绍单选框和复选框的操作 一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了 ...

  7. 微信小程序-修改单选框和复选框大小的方法

    方法有两种: 一:采用css的zoom属性 zoom缩放会将元素保持在左上角,并且会有毛边,可能会稍稍改变元素原来的形状. 二:采用css3的transform:scale属性 zoom缩放会将元素保 ...

  8. HTML--使用单选框、复选框,让用户选择

    在使用表单设计调查表时,为了减少用户的操作,使用选择框是一个好主意,html中有两种选择框,即单选框和复选框,两者的区别是单选框中的选项用户只能选择一项,而复选框中用户可以任意选择多项,甚至全选.请看 ...

  9. Selenium3+python自动化 单选框和复选框

    一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了,可以先抽他了. 二.radio和 ...

随机推荐

  1. SystemTap使用技巧 1 - 4 非常重要

    http://blog.csdn.net/wangzuxi/article/details/42849053

  2. 框架-数据库定义MD5加密

    1.--定义Md5加密declare @pt_pwd varchar(50)set @pt_pwd = ''set @pt_pwd = substring(sys.fn_sqlvarbasetostr ...

  3. ios Crash Log 分析汇总

    方法一: 1.xcode 有自带的symbolicatecrash,可以将.crash文件中的16进制地址转换成可读的函数地址. symbolicatecrash位于: /Applications/X ...

  4. Setup and Teardown Thread Group in Jmeter

    setup和teardown有点类似于每个测试用例开始和结束时要做的动作 A Thread Group is the starting point of any Jmeter Test Plan. A ...

  5. svm、logistic regression对比

    相同点:都是线性分类算法 不同点: 1.损失函数不同 LR:基于“给定x和参数,y服从二项分布”的假设,由极大似然估计推导 SVM: hinge loss + L2 regularization的标准 ...

  6. chrome 的onbeforeunload事件没有触发

    onbeforeunload event is not working when user not click inside the body of page 0down votefavorite   ...

  7. lua 暂停写法

    由于lua 不支持暂停 用其他方法变相实现 -- 暂停 hock 写法 function _M.sleep(n) if n > 0 then os.execute("ping -c & ...

  8. win32收不到F10按键消息解决的方法

    在WM_KEYDOWN中处理F10(VK_F10)消息总是获取不到,后来用spy++监听窗体消息发现按下F10并没有WM_KEYDOWN消息产生,而是产生了WM_SYSKEYDOWN

  9. 浅谈JavaScript的事件(事件对象)

    在触发DOM上的某个事件时,会产生一个事件对象event,这个对象中包含这所有与事件有关的信息.包括导致事件的元素.事件的类型和事件的相关信息.例如鼠标操作的事件中,会包含鼠标的位置信息.而键盘触发的 ...

  10. Codeforces Round #422 (Div. 2) B. Crossword solving 枚举

    B. Crossword solving     Erelong Leha was bored by calculating of the greatest common divisor of two ...