Наконец-то решил, переопределив jquery.treeview.async.js ... В этом файле я изменил функцию createNode, по умолчанию он добавлял тег span, вместо того, чтобы сделать его гиперссылкой ....
Теперь код выглядит следующим образом:
function createNode(parent) {
var current;
if(this.id && this.owner && this.menu){
if(this.menu=='users'){
current = $("<li/>").attr("id", this.id || "").html("<a class="+this.classes+" href=\"showDetails/\" onclick=\"jQuery.ajax({type:'POST',data:'employeeId="+this.id+"&resourceSel=All', url:'/Project/users/showDetails/',success:function(data,textStatus){jQuery('#behaviorDiv').html(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false;\">"+this.text+"</a>").appendTo(parent);
else{
current = $("<li/>").attr("id", this.id || "").html("<a class="+this.classes+" href=\"showActivityDetails/\" onclick=\"jQuery.ajax({type:'POST',data:'resourceName="+this.id+"&resourceSel=All', url:'/Project/resource/showActivityDetails/',success:function(data,textStatus){jQuery('#behaviorDiv').html(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false;\">"+this.text+"</a>").appendTo(parent);
}
И мой gsp имеет следующий код:
function initTrees () {jQuery ("# peerTreeView"). Treeview ({url: "/ Project/ peer / getSubTreeData ", ajax: {data: {" peerName ": '$ {peerName}'}, тип:" post "}})} jQuery (document) .ready (function () {initTrees ();});Ресурсы
$ {g.message (code: 'users.behavior.contentLabel')}
}
А внутри контроллера действие getSubTreeData имеет следующий фрагмент кода:
def getSubTreeData = {
def data = [
[ text:'Peer Activity',
id : params.peerName,
owner : 'Resources',
expanded: false,
classes: 'icon-userActivity',
menu : 'peer',
children: [
[ text: "By Day of Week", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "By Time of Day", classes:'icon-time', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "Holiday", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "Weekend", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "Daily", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "Weekly", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity'],
[ text: "Monthly", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'peerActivity']
]
],
[
text:'Network Sources',
id : params.peerName,
owner : 'Resources',
expanded: false,
classes: 'icon-networkSources',
menu : 'peer',
children: [
[ text: "By Day of Week", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "By Time of Day", classes:'icon-time', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "Holiday", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "Weekend", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "Daily", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "Weekly", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources'],
[ text: "Monthly", classes:'icon-date', id:params.peerName, menu : 'peer', owner:'networkSources']
]
]
]
render data as JSON
}