日期:2014-05-19  浏览次数:20828 次

求助 jquery simpleTree 怎么使用???
 jquery simple tree 怎么 添加 删除 拖动节点?

------解决方案--------------------

var simpleTreeCollection;
var name="";
var id="";
$(document).ready(function(){

simpleTreeCollection = $('.simpleTree').simpleTree({
autoclose: true,
afterClick:function(node){
//alert("text-"+$('span:first',node).text()+$('span:first',node).attr("pid"));
},
afterDblClick:function(node){
alert("text-"+$('span:first',node).text());
},
afterMove:function(destination, source, pos){
//alert("destination---"+destination.attr('id')+" source---"+source.attr('id')+" pos---"+pos);
},
afterAjax:function()
{ },
animate:true,
drag:false,
docToFolderConvert:true,
url:'<%=URL%>',
formid:'13005'
});
});
function addNode()
{
var temp=simpleTreeCollection.get(0).getSelected();
var d= temp.find('>span').attr("pid");
simpleTreeCollection.get(0).addNode("a","c",function(node1,node2)
{
alert(node1.find('>span').attr("pid"));
alert(node2.find('>span').text());
});
}
function isDrag()
{
var t=simpleTreeCollection.get(0).option.drag
simpleTreeCollection.get(0).option.drag=t?false:true;
}