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. openfalcon的安装和使用

    蛮复杂的样子 根据官方文档指导,一步一步走起:https://book.open-falcon.org/zh_0_2/quick_install/prepare.html 单机安装的过程:单击安装会把 ...

  2. Setup and Teardown Thread Group in Jmeter

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

  3. IOS常见错误分析解决(一直更新) 你值得收藏-综合贴

    -来自收藏总结 综合了好多的常见错误 1:clang failed with exit code 254 一:检測代码中 是否 有 NSLog 打印了 返回 void 的值. 2:Verify exi ...

  4. 深入JVM系列(二)之GC机制、收集器与GC调优(转)

    一.回顾JVM内存分配   需要了解更多内存模式与内存分配的,请看 深入JVM系列(一)之内存模型与内存分配 1.1.内存分配: 1.对象优先在EDEN分配2.大对象直接进入老年代 3.长期存活的对象 ...

  5. jquery 获取下拉框 某个text='xxx'的option的属性 非选中 如何获得select被选中option的value和text和......

    jquery 获取下拉框 某个text='xxx'的option的属性 非选中 5 jquery 获取下拉框 text='1'的 option 的value 属性值 我写的var t= $(" ...

  6. ZOJ 3230 Solving the Problems(数学 优先队列啊)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3230 Programming is fun, Aaron is ...

  7. ok6410[000] ubuntu1604_64bit下安装wps

    虽说Ubuntu下有自动的office工具,不过使用上体验很差.而国内最好的office软件也就是金山的wps. ------------------------------------------- ...

  8. openwrt gstreamer实例学习笔记(三.深入了解gstreamer 的 Element)

    在前面的部分,我们简要介绍过 GstElementFactory 可以用来创建一个element的实例,但是GstElementFactory不仅仅只能做这件事,GstElementFactory作为 ...

  9. netty5源代码探索(一)----ByteBuf初探

    Netty的各种简单介绍,总体架构就不介绍了,假设大家感觉的确须要,给我留言我再追加. 这里再推广一个自己做得netty+spring的集成方案,优化netty配置启动,并提供基础server搭建的配 ...

  10. T-SQL查询进阶--变量

    概述 变量对于一种语言是必不可少的一部分,当然,对于T-SQL来讲也是一样.在简单查询中,往往很少用到变量,但无论对于复杂的查询或存储过程中,变量都是必不可少的一部分. 变量的种类 在T-SQL中,变 ...