想写一个异步的treetable。具体说就是页面刚开始显示最顶层的节点(可能有多个)。当点击顶层节点以后到数据库里查询其下级节点并展开。依此类推。求教了。希望有详细说明。本人以前没用过jquery。

解决方案 »

  1.   

    http://download.csdn.net/detail/maonongwu/4248745 这是个例子 应能用上
      

  2.   

    楼主没用过jquery,还是先学学吧
    http://www.w3school.com.cn/jquery/
      

  3.   

    http://www.w3school.com.cn/jquery/
    这个我大致看了下。大概都能理解。
    网上(http://zhaozhi3758.iteye.com/blog/1399229)看到这样的写法:
    14.<script language="javascript">   
    15.  
    16.var $treeTable=null;   
    17.$(document).ready(function(){   
    18.          
    19.       $treeTable=$('#tableList').treeTable({   
    20.            theme:'vsStyle',   
    21.            expandLevel : 1,   
    22.            url:'lawCalling_loadTree.xhtml?fatherId=',   
    23.            callback:function(item) {   
    24.                 
    25.               var result= '<td style="text-align:left">'+item.name+'</td>'+   
    26.                           '<td >'+(item.modifyTime).replace("T"," ")+'</td>'+   
    27.                           '<td class="align-left" >'+   
    28.                           '【<a href="javascript:openURL(\'${contextPath}/lawCalling/lawCalling_info.xhtml?lawCalling.fatherId='+item.id+'\',\'新建【'+item.name+'】子模块\',\'addson'+item.id+'\',400,150)">添加子分类</a>】'+   
    29.                           '【<a href="javascript:openURL(\'${contextPath}/lawCalling/lawCalling_info.xhtml?lawCalling.id='+item.id+'\',\'编辑行业分类\',\'modify'+item.id+'\',400,150)">修改</a>】'+   
    30.                           '【<a onclick="del('+item.id+',this)" href="javascript:;">删除</a>】'+   
    31.                           '<a href="javascript:;" onclick="sort('+item.id+',true);">向上</a>'+   
    32.                           '<a href="javascript:;" onclick="sort('+item.id+',false);">向下</a>'+   
    33.                           '</td>';   
    34.                return result;                    
    35.            },   
    36.            beforeClick: function($treeTable, id) {   
    37.                //异步获取数据 这里模拟替换处理   
    38.                $treeTable.refreshPoint(id);   
    39.            },   
    40.            beforeExpand : function($treeTable, id) {      
    41.               
    42.            },   
    43.            beforeClose : function($treeTable, id) {     
    44.             
    45.            }   
    46.        });   
    47.  
    48.}); 
      
    第19行:treeTable({   
    花括号里边的属性都是什么意思?
    jquery.treeTable.js里边没有这些东西啊。
      

  4.   

    jquery.treeTable.js(http://ludo.cubicphuse.nl/jquery-plugins/treeTable/doc/)
    这个插件里没这些属性。有以下属性:
    childPrefix
    clickableNodeNames
    expandable
    ...
    官网上的写法是:
    $("#example3").treeTable({
      expandable: false//上面的第三个属性。
    });
    我了解的实在是有限。望详解。
      

  5.   

    http://zhanchaojiang.iteye.com/blog/1036454
    参照这个帖子,应该有用
      

  6.   

    给你推荐一个JQUERY插件吧jqueryLiger,完全可以符合你的要求,简单大方
      

  7.   

    谢谢六楼的demo。好用。问题解决了。