Drill Up on the parent node

4 posts, 0 answers
  1. Sekhar
    Sekhar avatar
    22 posts
    Member since:
    Dec 2013

    Posted 11 Dec 2013 Link to this post

    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.

  2. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 16 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sekhar
    Sekhar avatar
    22 posts
    Member since:
    Dec 2013

    Posted 16 Dec 2013 Link to this post

    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?
  5. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 17 Dec 2013 Link to this post

    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.
Back to Top