2

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

steve
  • 41
  • 6

2 Answers2

1

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

John
  • 19
  • 3
0

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.

SteveCav
  • 6,649
  • 1
  • 50
  • 52