$('#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. Sonar + Jacoco,强悍的UT, IT 双覆盖率统计(转)

    以前做统计代码测试覆盖,一般用Cobertura.以前统计测试覆盖率,一般只算Unit Test,或者闭上眼睛把Unit Test和Integration Test一起算. 但是,我们已经过了迷信UT ...

  2. 在hdfs上存取xml文件的实现代码

    要读取的文件为:/user/hdfs/stdin.xml <?xml version="1.0" encoding="UTF-8"?> <re ...

  3. Think Python - Chapter 16 - Classes and functions

    16.1 TimeAs another example of a user-defined type, we’ll define a class called Time that records th ...

  4. java apache commons HttpClient发送get和post请求的学习整理(转)

    文章转自:http://blog.csdn.net/ambitiontan/archive/2006/01/06/572171.aspx HttpClient 是我最近想研究的东西,以前想过的一些应用 ...

  5. archlinux下查看机器的ip地址

    问题原因 默认archlinux没有安装ifconfig这个在其它发行版中常用的命令,刚开始不知道怎么查看机器的ip. 解决方案 使用archlinux中已经安装的ip命令.在后面跟上addr, ro ...

  6. 2015GitWebRTC编译实录4

    2015.07.17 libg711 编译通过[422/1600 ] CC obj /webrtc/modules/audio_coding/codecs/g711/g711.g711.o[423/1 ...

  7. android 升级APK

    Intent intent = new Intent(); //执行动作 intent.setAction(Intent.ACTION_VIEW); //执行完打开应用 intent.setFlags ...

  8. root密码

    安装完Ubuntu后忽然意识到没有设 置root密码,不知道密码自然就无法进入根用户下.到网上搜了一下,原来是这麽回事.Ubuntu的默认root密码是随机的,即每次开机都有一个新的 root密码.我 ...

  9. Eclipse中web-inf和meta-inf文件夹的信息

    http://www.cnblogs.com/chinafine/archive/2010/06/13/1757514.html WEB-INF     /WEB-INF/web.xml        ...

  10. HDU 1029 Ignatius and the Princess IV --- 水题

    HDU 1029 题目大意:给定数字n(n <= 999999 且n为奇数 )以及n个数,找出至少出现(n+1)/2次的数 解题思路:n个数遍历过去,可以用一个map(也可以用数组)记录每个数出 ...