This is a migrated thread and some comments may be shown as answers.

Drill Up on the parent node

3 Answers 92 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Sekhar
Top achievements
Rank 1
Sekhar asked on 11 Dec 2013, 05:11 PM
Hi,

In the orgchart how can i have the drill up button. Meaning when i want the ability to go up one level from the parent node.
lets say  the starting point of a chart is A who has reportees B and C and C in turn has E and F as reprotees. Currently  the default mature of the orgchart is to show the drill down icon on C and when i drill down to C it has two icons go to parent and go to root. Can i have these go to parent icon on node A. Meaning if A has a manager he can Drill Up.

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 16 Dec 2013, 02:55 PM
Hi Sekhar,

In the current implementation of RadOrgChart the root node (that is A in your example) does not have drill down icons -they are only shown if a node have a parent node.

Hope this will explain the issue.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sekhar
Top achievements
Rank 1
answered on 16 Dec 2013, 04:22 PM
Thank you Plamen.
Other than the CEO of a company most of the other folks have parent. So Even though our Parent in this Case is A that is the starting point of a chart, but since has a manager A1 can't we mimic and show the drill up icon at node A?
0
Plamen
Telerik team
answered on 17 Dec 2013, 12:57 PM
Hello Sekhar,

You can achieve such behavior by overriding the default showToolbar event in RadOrgChart and allow showing the icons even on hovering the root node or by checking some other custom possibility:
<script type="text/javascript">
          var $ = $telerik.$;
 
          Telerik.Web.UI.RadOrgChart.prototype._showToolbar = function (e) {
              this._resetToolbarVisibility();
               
              var $element = $(e.currentTarget),
                  offset = $element.offset(),
                  node = $element.parents(".rocNode")[0],
                  $node = $(node),
                  isDrillRootNode = $node.hasClass("rocDrillDownNode"),
                  isRootNode = !isDrillRootNode && $node.hasClass("rocRootNode");
 
              if (isRootNode) {
                 // return;
                  $(this._toolbar.goToParentButton.parentNode).removeClass("rocHidden");
                  $(this._toolbar.goToRootButton.parentNode).removeClass("rocHidden");
              }
              else if (isDrillRootNode) {
                  $(this._toolbar.goToParentButton.parentNode).removeClass("rocHidden");
                  $(this._toolbar.goToRootButton.parentNode).removeClass("rocHidden");
              }
              else {
                  $(this._toolbar.drillHereButton.parentNode).removeClass("rocHidden");
 
              }
 
              this._toolbar.style.left = offset.left + "px";
              this._toolbar.style.top = (offset.top - $(this._toolbar).outerHeight() - 2) + "px";
              this._toolbar.style.display = "block";
              var nodeObject = this._extractNodeFromDomElement(e.target)
 
              this._toolbar.currentNodeHierarchicalIndex = nodeObject._getHierarchicalIndex();
 
              window.clearTimeout(this._hideToolbarTimeOut);
          };
 
      </script>


Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
OrgChart
Asked by
Sekhar
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Sekhar
Top achievements
Rank 1
Share this question
or