1、easyUI 的tree 修改节点:
我需要:切换语言状态,英文下, 修改根节点文本,显示英文。
操作位置:在tree的显示 $('#tree').tree(),onLoadSuccess事件方法中,参数:node,data(详见easyUI文档)
代码:                 var t = $(this);                 
                    if (data) {
                        var troot = t.tree("getRoot");
                        if (troot) {
                            troot.text = 'MechinalCategory';
                            t.tree("update", troot);
 
                        };}
与easyui 介绍的update方法有些不同,
easyui,文档update方法是这样介绍的
 
更新指定的节点,'param' 参数有下列属性:
target(DOM 对象,要被更新的节点)、id、text、iconCls、checked,等等。
 
代码实例:
// update the selected node text
var node = $('#tt').tree('getSelected');
if (node){
    $('#tt').tree('update', {
        target: node.target,
        text: 'new text'
    });
}
不过我在用时,总是报错typeError:无法获取指定的属性什么check之类的。
我当时是这么用的
             var troot = t.tree("getRoot");
                        if (troot) {
                            troot.text = 'MechinalCategory';
                            t.tree("update", {target:troot,text:'MechinalCategory'});
                            }
我也不是很清楚这是什么原因造成的,如果你知道,请一定要告诉我,谢谢!
2、查找所有子节点
with tab as
(
 select IsId,ParentId,CategoryName from tb_MechanicalEquipmentCategory where IsId=116--父节点
 union all
 select b.IsId,b.ParentId,b.CategoryName 
 from
  tab a,--父节点数据集
  tb_MechanicalEquipmentCategory b--子节点数据集 
 where b.ParentId= a.IsId --子节点数据集.ID=父节点数据集.parendID
 )
select * from tab
 
3、查找所有父节点
with tab as
(
 select Type_Id,ParentId,Type_Name from Sys_ParamType_V2_0 where Type_Id=316--子节点
 union all
 select b.Type_Id,b.ParentId,b.Type_Name 
 from
  tab a,--子节点数据集
  Sys_ParamType_V2_0 b  --父节点数据集
 where a.ParentId=b.Type_Id  --子节点数据集.parendID=父节点数据集.ID
)
select * from tab;
4、比较复杂的sql查询,主要是将查找所有子节点的数据,再分页。三部分之一:
with tab as (select IsId,ParentId,CategoryName from tb_MechanicalEquipmentCategory where IsId=4 union all select b.IsId,b.ParentId,b.CategoryName from tab a, tb_MechanicalEquipmentCategory b where b.ParentId= a.IsId) 
三部分之二:
 ,m as(select row_number() over(order by Guid  asc) rowid,* from VW_MechanicalEquipment where 1=1 and VW_MechanicalEquipment.CategoryId in(select isid from tab) )
最后
select * from m where rowid  between (1-1)*10+1 and 10*1
 

easyUI 的tree 修改节点,sql递归查询的更多相关文章

  1. EasyUI Tree判断节点是否是叶

    方法1:  $('#domaincatalog').tree('isLeaf', node.target); 返回true或false ,true表示是叶节点, false即不是 方法2:官方文档中: ...

  2. 如何让EasyUI的Tree或者ComboTree节点不显示图标?

    版本:jQuery EasyUI 1.3.2 通过测试,只需把节点的state属性设置为null即可使EasyUI的Tree或者ComboTree控件的节点不显示图标.

  3. easyui的tree节点的获取和选中

    1.设置选中tree的节点 var node = $('#tt').tree('find', 1);//找到id为”tt“这个树的节点id为”1“的对象$('#tt').tree('select', ...

  4. EasyUI Editable Tree

    效果如图: Create Tree <ul id="tt"></ul> $('#tt').etree({ url: 'tree_data.json', cr ...

  5. 第二百二十六节,jQuery EasyUI,Tree(树)组件

    jQuery EasyUI,Tree(树)组件 本节课重点了解 EasyUI 中 Tree(树)组件的使用方法,这个组件依赖于 Draggable(拖 动)和 Droppable(放置)组件. 一.加 ...

  6. 做权限树时 使用EasyUI中Tree

    符合EasyUI中Tree的Json格式,我们先看一下,格式是如何的 [{ "id":1, "text":"My Documents", & ...

  7. 【转】sql递归查询问题

    原文链接地址http://www.cnblogs.com/sweting/archive/2009/06/08/1498483.html 在工作中遇到一个问题,是需要sql递归查询的.不懂,于是到cs ...

  8. easyUI的tree

    前端使用easyUI,放了一个tree,搞死了. easyUI的tree,后端传过来的数据,是json格式:然后easyUI向后端提交.请求时,会自动将节点的id附在url后面. 主要有两个注意的地方 ...

  9. 使用EasyUI中Tree

    easyui里面的加载tree的两种方式 第一种: 使用EasyUI中Tree 符合EasyUI中Tree的Json格式,我们先看一下,格式是如何的 [{ , "text":&qu ...

随机推荐

  1. MBProgressHud添加自定义动画

    在使用自定义view时,若直接使用,如下 MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud ...

  2. 记一次TFS 的 垃圾提示(无法下载 未获取项目 的 代码)

    提示 “ 所有文件都是最新的 ”,但是在 源码管理 里面 确是 “未下载” 我艹,第一次遇到.如图.~~ 最后发现是 TFS 的项目权限设置问题. 你妈个马批的,啥子鸡巴破B提示,太阳你妈B 的 .要 ...

  3. NES模拟器开发-PPU笔记

    20151008 占坑,暂时没弄清楚PPU数据如何初始化,绘制顺序等.

  4. 在Abp中集成Swagger UI功能

    在Abp中集成Swagger UI功能 1.安装Swashbuckle.Core包 通过NuGet将Swashbuckle.Core包安装到WebApi项目(或Web项目)中. 2.为WebApi方法 ...

  5. docke部署mysql

    #1    docker pull mysql #2    docker run -v /data/var/mysql/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=k ...

  6. oracle 密码过期处理

    1.查看用户的proifle是哪个,一般是default sql>SELECT username,PROFILE FROM dba_users; 2.查看指定概要文件(如default)的密码有 ...

  7. Google Earth API 替换方案

    众所周知,GE API将会在15年12月25日结束服务,对于众多采用该API的软件,需要一些替换方案. 例如google map或者cesiumjs http://cesiumjs.org/ 或者尝试 ...

  8. C# 反转字符串

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 实现字符 ...

  9. easyui datagrid加载json

      服务端: string pseries = context.Request["ajaxSearch"].ToString().Trim(); var jsonMap = new ...

  10. zend studio常用快捷键

    1.提示符助手快捷键 alt+/ 你可以自定义 window->keys->Content assist->Binding 2.复制当前行 alt+ctrl+下 3.删除 ctrl+ ...