$('#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. 插入并列div使其居中

    <!doctype html><html> <head> <meta charset="UTF-8"> <meta name= ...

  2. NSData和NSString 、 NSFileManager

    1 NSData和NSMutableData的基本使用 1.1 问题 NSData类是IOS提供的用于以二进制的形式操作文件数据的类,NSData有两个常用的属性length和bytes,length ...

  3. csdn第八名

    编号:1028时间:2016年7月18日11:49:17功能:csdn第八名URL :http://blog.csdn.net/21aspnet

  4. C++ 并发消息队列

    C++ 并发消息队列 在网上找到了一份POSIX线程显示的并发消息队列示例代码: http://codereview.stackexchange.com/questions/41604/thread- ...

  5. 六 JSP 和 Servlet 的系统调优技巧

    方法一:在 Servlet 的 init() 函数中申请缓冲数据 方法二:禁止 Servlet 和 JSP 的自动重载: Servlet/JSP 提供了一个实用的技术,即自动重载技术,它为开发人员提供 ...

  6. 浅谈github页面域名绑定

    来源:http://yanping.me/cn/blog/2011/12/04/github-pages-domain/ 前段时间看到COS上的各位都有博客,也想开个博,给COS的各位管理员发邮件,向 ...

  7. Java-->实现群聊功能(C/S模式--TCP协议)

    --> Java 对TCP协议的支持: --> java.net包中定义了两个类ServerSocket 和Socket ,分别用来实现双向连接的server 端和client 端. -- ...

  8. meta 标签 关键字 用处

    您的个人网站即使做得再精彩,在“浩瀚如海”的网络空间中,也如一叶扁舟不易为人发现,如何推广个人网站, 人们首先想到的方法无外乎以下几种: l 在搜索引擎中登录自己的个人网站 l 在知名网站加入你个人网 ...

  9. 转ORA-28002: the password will expire within 7 days 解决方法

    最后一步要改密码,否则还会报错. 1. 查看用户的profile设置: SELECT username,profile FROM dba_users; 一般用户的profile设置都为DEFAULT. ...

  10. 查看PHP的配置信息

    查看PHP的配置信息其实一个函数就搞定了. 首先在服务器的根目录建立phpinfo.php文件. 然后打开此文件输入以下内容 <?php phpinfo(); ?> 保存此文件之后在浏览器 ...