});
//var ids=idArray.join(‘,’);
alert(idArray);
//alert(ids);
}
function nodeEvent(desc,id){
$(“#content”).load(“@{Application.codepiece()}”,{“desc”:desc,”id”:id});
}
function _callBack(d){
var re = [], expIds = [], attr = {};
jQuery.each(d, function(i){
var state = ‘closed’;
var data = ”;
var onclick = ”;
var href = ”;
var image = ”;
if (!d[i].leaf == ‘0’) {
state = null;
var desc = d[i].decription;
var id = d[i].id;
image = “@{‘/public/images/file.png’}”
onclick = “nodeEvent(”” + desc + “”,” +id + “)”;
href = “javascript:nodeEvent(”” + desc + “”,” + id + “);”;
}else{
onclick = “”;
//image = “@{‘/public/images/folder.png’}”
}
re.push({
“attr”: {
“id”: d[i].id
},
“data”: {
“title”: d[i].name,
“attr”: {“onClick” : onclick}
},
“state”: state,
“icon”: image
});
});
return re;
}
$(function () {
var ctmitems = {};
var isadmin = 0;
var plugins = [];
#{if user}
ctmitems = {“ccp”: null};
plugins = [ “themes”, “json_data”, “ui”,”hotkeys”, “crrm”, ‘dnd’, “search”, “types”, “cookies”, “contextmenu”, “checkbox”];
isadmin = 1;
$(‘#userinfo’).html(‘管理员:’+ ‘${session.get(“user”)}’);
#{/if}
#{else}
$(‘#userinfo’).html(‘普通用户:’+ ‘${session.get(“user”)}’);
ctmitems = {“new”: null,”ccp”: null,”rename”: null, “remove”: null}
plugins = [ “themes”, “json_data”, “ui”,”hotkeys”, “crrm”, “search”, “types”, “cookies”, “contextmenu” ];
#{/else}
var tree = $(“#tree”).jstree({
themes: {
“theme”: “apple”,
“dots” : false,
“icons” : true
},
“json_data”: {
“ajax”: {
“url”: ‘@{Application.getData()}’,
“async”: true,
“data”: function(n){
return {
“id” : n.attr ? n.attr(“id”) : null
};
},
“success”: function(d){
return _callBack(d);
}
},
“progressive_render” : true
},
“ui”:{
“initially_select”:[“1”]
},
“core” : {
“initially_open” : [“1”, “7”]










