GetOrgChart: How do I disable the default behaviour of a click going to the details view?

1.5k views Asked by At

Using getOrgChart.com

How do I disable the default behaviour of a click going to the details view? I have set editable to false. I am including an xlink in the box which works but the details view is initially visible before the link goes to the the href?

[EDIT] I found that I could disable default behaviour with a return false on the click parameter

2

There are 2 answers

0
John On

To disable details view you have to attach to the click event. Here is an example:

$("#people").getOrgChart({  
primaryColumns: ["Name", "Title"],
clickEvent: function(sender, args){
//if (args.id == 3)
return false;
},
dataSource: [
{ id: 1, parentId: null, Name: "Amber McKenzie", Title: "ESL teacher"},
{ id: 2, parentId: 1, Name: "Ava Field", Title: "Bricklayer"},
{ id: 3, parentId: 1, Name: "Evie Johnson", Title: "Nursing aide"}]
});

see the demo here

0
SteveCav On

I use this to divert to my own details page (in ASP.NET MVC):

            clickEvent: function(sender, args){
                    window.location.replace('../Employee/DetailsByLocalID?id=' + args.id);
                    return false;
                },

The "return false;" appears redundant, but if I don't do it the default GetOrgChart detail screen appears for a moment and then is replaced by mine.