$('#tree1').tree({
url:'${contextPath}/pedition/treelistJc.html?editionUid=${ formatEdition.ppmId}',
onAfterEdit:function(node){
var count = 0;
for(var i = 0 ; i < node.text.length ; i++) {
if ((node.text.charCodeAt(i)>=0) && (node.text.charCodeAt(i)<=255)) {
count=count+1;
}else {
count=count+3;
}
}
if(count<1 || count>150){
var message = "";

if(node.text.length<1) {
message = "ÇëÊäÈëÕ½ÚÃû³Æ";
}
if(count>150) {
message = "Õ½ÚÃû³Æ²»Äܳ¬¹ý150¸öÓ¢ÎÄ»ò50¸öÖÐÎÄ×Ö";
}

$.messager.alert("Ìáʾ",message,"info");
$('#tree1').tree('beginEdit', node.target);
return ;
}
var reg = /^[a-zA-Z0-9._@\u4E00-\u9FA5]+$/;
if(!reg.test(node.text)) {
$.messager.alert("Ìáʾ","Ö»ÔÊÐíÊäÈ뺺×Ö¡¢Ó¢ÎÄ×Öĸ¡¢Êý×Ö¼°Ï»®Ïߣ¬µã£¬@","info");
node.text = "н¨Õ½Ú";
$('#tree1').tree('beginEdit', node.target);
return ;
}
$('#laHide').hide();
$('.easyui-linkbutton').linkbutton('enable');
$('.easyui-menubutton').menubutton('enable');
//alert("Íê³É±à¼­"+node.text+"--"+nodexu.text);
if((nodexu == null || nodexu==""|| (nodexu!=""&&nodexu.id!=node.id)) && buttonflag!="edit_section"){
var parentid="null";
if(nodexu!="" && nodexu!=null){
parentid=nodexu.id;
}
if(buttonflag=="add_section" || nodexu == null){
parentid="null";
}
var myprojectid="";
var mydocUid="";
var myeditionUid="";
if('${formatEdition.projectId}'!=""){
myprojectid='${formatEdition.projectId}';
}
if('${formatEdition.docUid}'!=""){
mydocUid='${formatEdition.docUid}';
}
if('${ formatEdition.ppmId}'!=""){
myeditionUid='${ formatEdition.ppmId}';
}
//alert(node.text);
$.ajax({
type: "POST",
url: "${contextPath}/pedition/addJc.html",
data: {
previewContent:node.text,
parentid:parentid,
projectId:'${formatEdition.projectId}',
editionUid:'${ formatEdition.ppmId}',
docUid:'${ formatEdition.docUid}'
},
dataType: 'json',
success: function(msg){
buttonflag= "";
$('#tree1').tree('reload');

}
});
}else{
$.ajax({
type: "POST",
url: "${contextPath}/pedition/editJc.html",
data: {
id:node.id,
previewContent:node.text
},
dataType: 'json',
success: function(msg){
buttonflag =="";
$('#tree1').tree('reload');
}
});
}
},
onClick:function(node) {
$('#laHide').hide();
$('#add_sub_section').linkbutton('enable');
$('#add_section').linkbutton('enable');
$('#edit_section').linkbutton('enable');
$('#del_section').linkbutton('enable');
$('#import_work').menubutton('enable');

nodexu=node;
currentNode = node.id;
window.frames["framesouth"].document.location.href='${contextPath}/pedition/toDocItemListView.html?docUid=${ formatEdition.docUid}&docEditionUid=${ formatEdition.ppmId}&isCurrent=${ formatEdition.isCurrent}&sectionUid='+node.id;
},
onBeforeEdit:function(node){
//node.text=node.attributes.truetext.substr(0,node.attributes.truetext.indexOf("("));
//node.text=node.text.substr(0,node.text.indexOf("("));
if(node.attributes!=undefined&&node.attributes.ttext!=undefined){
//alert(node.attributes.ttext+"--22");
node.text=node.attributes.ttext;
}else {
node.text="н¨Õ½Ú";
}
$('#laHide').show();
$('.easyui-linkbutton').linkbutton('disable');
$('.easyui-menubutton').menubutton('disable');
},
onLoadSuccess:function(node, data){
$('#laHide').hide();
var roots = $('#tree1').tree("getRoots");
if(roots.length == 0) {
$('#add_sub_section').linkbutton('disable');
$('#edit_section').linkbutton('disable');
$('#del_section').linkbutton('disable');
$('#import_work').menubutton('disable');
}else {
$('.easyui-linkbutton').linkbutton('enable');
$('.easyui-menubutton').menubutton('enable');
}

if(!currentNode){
$('#tree1').tree("select",roots[0].target);
var selectNode = $('#tree1').tree('getSelected');
window.frames["framesouth"].document.location.href='${contextPath}/pedition/toDocItemListView.html?docUid=${ formatEdition.docUid}&&docEditionUid=${ formatEdition.ppmId}&isCurrent=${ formatEdition.isCurrent}&sectionUid='+selectNode.id;
}else{
var cnode = $('#tree1').tree("find",currentNode);//alert(cnode==null);
if(cnode!=null){
$('#tree1').tree("select",cnode.target);
window.frames["framesouth"].document.location.href='${contextPath}/pedition/toDocItemListView.html?docUid=${ formatEdition.docUid}&&docEditionUid=${ formatEdition.ppmId}&isCurrent=${ formatEdition.isCurrent}&sectionUid='+cnode.id;
}else {
$('#tree1').tree("select",roots[0].target);
var selectNode = $('#tree1').tree('getSelected');
window.frames["framesouth"].document.location.href='${contextPath}/pedition/toDocItemListView.html?docUid=${ formatEdition.docUid}&&docEditionUid=${ formatEdition.ppmId}&isCurrent=${ formatEdition.isCurrent}&sectionUid='+selectNode.id;
}
}
},
onContextMenu: function(e, node){
e.preventDefault();
// ²éÕÒ½Úµã
$('#tree1').tree('select', node.target);
// ÏÔʾ¿ì½Ý²Ëµ¥
$('#mm').menu('show', {
left: e.pageX,
top: e.pageY
});
},
onLoadError:function(arr) {
$('#laHide').show();
$('#add_sub_section').linkbutton('disable');
$('#edit_section').linkbutton('disable');
$('#del_section').linkbutton('disable');
$('#import_work').menubutton('disable');
}

});

tree 查询出数据遍历tree的更多相关文章

  1. SQL Server数据库Union和Union All查询出数据的区别?

    好久没有更新博客了,可能是最近比较忙,总是忽略了一些事情,今天查了做了一些数据分析的数据,突然感觉对Union和Union all有些不太理解了,可能是自己老了吧,就翻了一些资料,进行回忆和学习,趁着 ...

  2. 【MySQL】MySQL中查询出数据表中存在重复的值list

    1.目的:查询MySQL数据表中,重复记录的值 2.示例: 3.代码: select serial_num,count(*) as count FROM card_ticket GROUP BY se ...

  3. 测试分页查询出数据并分文件导出[java工程]

    package cn.shiyanjun.test; import java.util.ArrayList; import java.util.List; public class ExcelTest ...

  4. SQL Server将查询出数据进行列转行操作

    在日常的SQL Server数据查询时经常会遇到需要将数据列转换成行的操作,现将自己学习的列转行SQL语句举例如下: --首先查询语句 SELCT * FROM  YXBAK..TBYJKSTEMP ...

  5. sql语句查询出数据重复,取唯一数据

    select distinct mr.id,ifnull(mr.pid,0) as pid,mr.name from sys_role_res srr left join main_res mr on ...

  6. oracle - 查询某些表是空白,需要提升权限后,才可查询出数据

    begin fnd_global.apps_initialize(user_id => 1150 ,resp_id => 50738 ,resp_appl_id => 660 ); ...

  7. SubSonic3.0使用外连接查询时查询不出数据的问题修改

    今天在开发时,要使用到外连接查询,如图 老是查不出数据,所以就追踪了一下代码,发现查询后生成的SQL语句变成了内连接了,真是晕 然后继续Debug,发现原来SqlQuery类在调用LeftInnerJ ...

  8. sql语句中查询出的数据添加一列,并且添加默认值

    查询出数据,并且要添加一列表中都不存在的数据,且这一列的值都是相等的 select app_id,app_secret from wx_ticket group by app_id; 查询出的数据是 ...

  9. Saiku根据入参日期查询出对应的数据(二十)

    Saiku根据入参日期查询出对应的数据 之前好像有写过一篇博客关于saiku date range的,现在进一步更新啦!!! 这里的日期筛选会更完善一些,需要提供两个参数 开始日期与结束日期(star ...

随机推荐

  1. Android Material Design : Ripple Effect水波波纹荡漾的视觉交互设计

     Android Material Design : Ripple Effect水波波纹荡漾的视觉交互设计 Android Ripple Effect波纹荡漾效果,是Android Materia ...

  2. [转]LUA 学习笔记

    Lua 学习笔记 入门级 一.环境配置 方式一: 1.资源下载http://www.lua.org/download.html 2.用src中的源码创建了一个工程,注释调luac.c中main函数,生 ...

  3. 接口变化统计工具--Clirr

    最近学习Mybatis的官方文档,看到了[项目文档]一节有很多内容没有见过,做个笔记,理解一下. 当写一个公共库,或者SDK,版本与版本之间迭代之后,总会发生接口的变化,而这些变化,都需要向外界进行告 ...

  4. Maven构建web项目在Eclipse中部署的几种方法

    目录: 方法一:运用Maven的plugin:jetty来部署web 方法二:运用Eclipse 的Jetty插件直接部署 方法三:运用Run on Server(tomcat)部署 [方法一].运用 ...

  5. shell 脚本实战笔记(1)--source/fork/exec的区别

    在linux shell编程中, 随着脚本处理规模的变大, 会嵌套调用子进程. 但父进程以不同的方式调用子进程, 其结果和背后的机制不尽相同.这边就简单描述下source/fork/exec调用子进程 ...

  6. map的相关

    private static final Map<String, String> flagMap = new HashMap<String, String>(); static ...

  7. Spring MVC 使用拦截器优雅地实现权限验证功能

    在上一篇 SpringAOP 实现功能权限校验功能 中虽然用AOP通过抛异常,请求转发等勉强地实现了权限验证功能,但感觉不是那么完美,应该用拦截器来实现才是最佳的,因为拦截器就是用来拦截请求的,在请求 ...

  8. poj3249 Test for Job ——拓扑+DP

    link:http://poj.org/problem?id=3249 在拓扑排序的过程中进行状态转移,dp[i]表示从起点到 i 这个点所得到的的最大值.比如从u点到v点,dp[v]=max(dp[ ...

  9. 工作中遇到的问题--实现程序运行时就加载CustomerSetting的第二种方法

    写一个自定义注解 @Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})@Retention(Retention ...

  10. HDU 1231 最大连续子序列 --- 入门DP

    HDU 1231 题目大意以及解题思路见: HDU 1003题解,此题和HDU 1003只是记录的信息不同,处理完全相同. /* HDU 1231 最大连续子序列 --- 入门DP */ #inclu ...