$('#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. The name 'Scripts' does not exist in the current context error in MVC

    创建完成ASP.NET MVC4应用程序以后,试着运行其中一个Create页面, 程序报出运行是错误: CS0103: The name 'Scripts' does not exist in  th ...

  2. tracking 问题解决

    1.dir,或者C++函数读文件名,不推荐.搞乱了名字 2. matio读写矩阵

  3. nginx的upstream目前支持5种方式的分配(转)

    nginx的upstream目前支持5种方式的分配 1.轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除. 2.weight 指定轮询几率,weight ...

  4. 设置mysql远程连接root权限

    在远程连接mysql的时候应该都碰到过,root用户无法远程连接mysql,只可以本地连,对外拒绝连接.需要建立一个允许远程登录的数据库帐户,这样才可以进行在远程操作数据库.方法如下:默认情况下MYS ...

  5. hdu 5187 zhx's contest

    题目分析如果n=1,答案是1,否则答案是2n−2. 证明:ai肯定是最小的或者最大的.考虑另外的数,如果它们的位置定了的话,那么整个序列是唯一的. 那么ai是最小或者最大分别有2n−1种情况,而整个序 ...

  6. ZOJ 1151 Word Reversal

    原题链接 题目大意:给一句话,把每个单词倒序,然后输出. 解法:我是用了一个堆栈,以空格来拆分单词,把每个字母压入堆栈,然后依次输出. 参考代码: /* * 字符串反向,140ms,188kb * 单 ...

  7. ListView滚动到顶部

    videoAdapter.notifyDataSetChanged();videoListView.setSelection(0); 注意顺序先notify后setSelection

  8. 转:如何理解c和c ++的复杂类型声明

    本文作者girlrong是网易广州社区的C语言版版主,这篇文章被选在精华区.很是不错,不敢独享!据说她乐于助人,虚心诚恳,颇受网友欢迎.只可惜现在已退隐江湖了.在最近学习C语言过程中,了解些前辈大牛的 ...

  9. JavaWeb学习记录(十六)——防止表单重复提交

    产生随机字符串进行验证,如果产生的和Session存储的相同则可以提交,提交后删除session对应的属性值:否则表单提交不成功 一.产生随机字符串的工具类 package web10.util; i ...

  10. hdu3861 强连通+最小路径覆盖

    题意:有 n 个点,m 条边的有向图,需要将这些点分成多个块,要求:如果两点之间有路径能够互相到达,那么这两个点必须分在同一块:在同一块内的任意两点相互之间至少要有一条路径到达,即 u 到达 v 或 ...