Class OrgChart

All Implemented Interfaces:
AttachNotifier, ClickNotifier<Div>, DetachNotifier, HasComponents, HasElement, HasEnabled, HasOrderedComponents, HasSize, HasStyle, HasText, Serializable

@NpmPackage(value="orgchart",version="3.7.0") @NpmPackage(value="html2canvas",version="1.4.1") @NpmPackage(value="jquery",version="3.6.2") @NpmPackage(value="json-digger",version="2.0.2") @JsModule("jquery/dist/jquery.js") @JsModule("orgchart/dist/js/jquery.orgchart.js") @JsModule("./fc-orgchart.js") @CssImport("orgchart/dist/css/jquery.orgchart.min.css") @CssImport("./fc-orgchart-styles.css") @Tag("fc-orgchart") public class OrgChart extends Div
OrgChart component definition.
Uses JQuery library OrgChart to show an organization chart.
More information about this library at https://github.com/dabeng/OrgChart
Author:
pbartolo
See Also:
  • Constructor Details

  • Method Details

    • onAttach

      protected void onAttach(AttachEvent attachEvent)
      Overrides:
      onAttach in class Component
    • initializeChart

      @Deprecated public void initializeChart()
      Deprecated.
      This method is no longer needed. Initialization is done in onAttach(AttachEvent).
    • setValue

      public void setValue(OrgChartItem orgChartItem)
    • getState

      protected OrgChartState getState()
    • setChartNodeTitle

      public void setChartNodeTitle(String chartNodeTitle)
    • setChartNodeContent

      public void setChartNodeContent(String chartNodeContent)
    • setChartDirection

      public void setChartDirection(String chartDirection)
    • setChartTitle

      public void setChartTitle(String chartTitle)
    • setChartZoom

      public void setChartZoom(Boolean chartZoom)
    • setChartExportButton

      public void setChartExportButton(Boolean chartExportButton)
    • setChartExportFileName

      public void setChartExportFileName(String chartExportFileName)
    • setChartExportFileExtension

      public void setChartExportFileExtension(String chartExportFileExtension)
    • setChartPan

      public void setChartPan(Boolean chartPan)
    • setChartZoominLimit

      public void setChartZoominLimit(Double chartZoominLimit)
    • setChartZoomoutLimit

      public void setChartZoomoutLimit(Double chartZoomoutLimit)
    • setChartDepth

      public void setChartDepth(Integer chartDepth)
      orgchart visibleLevel option
    • setChartVerticalDepth

      public void setChartVerticalDepth(Integer chartVerticalDepth)
      orgchart verticalLevel option
    • setChartToggleSiblingsResp

      public void setChartToggleSiblingsResp(Boolean chartToggleSiblingsResp)
    • setChartExpandCollapse

      public void setChartExpandCollapse(Boolean chartExpandCollapse)
    • setChartDraggable

      public void setChartDraggable(Boolean chartDraggable)
    • getOrgChartItem

      public OrgChartItem getOrgChartItem()
      Returns latest value of the orgchart element.
    • onClick

      @ClientCallable public void onClick(String nodeId)
      Fires event on node click.
      Parameters:
      nodeId -
    • updateDraggedNode

      @ClientCallable public void updateDraggedNode(String draggedNode, String dragZone, String dropZone)
      Updates chart after drag and drop event.
      Parameters:
      draggedNode -
      dragZone -
      dropZone -
    • setNodeTemplate

      public void setNodeTemplate(String parameterName, String functionBody)
      Sets the template generation function used to customize the internal structure of nodes. functionBody is the body of a javascript function that recieves one parameter (the JSON datasoure representing a node) and returns an HTML snippet. The name of this parameter is given by parameterName.

      Example: setNodeTemplate("item","return ''+item.name+'';") configures the following JS function as node template: function(item) { return ''+item.name+''; } custom properties are accessible through item.data

      Parameters:
      parameterName - the name of the parameter of a javascript function
      functionBody - the body of a javascript function
    • addDragAndDropListener

      public void addDragAndDropListener(ComponentEventListener<OrgChart.DragAndDropEvent> listener)
      Adds a OrgChart.DragAndDropEvent listener to the component.
      Parameters:
      listener - the listener to be added.
    • fireDragAndDropEvent

      protected void fireDragAndDropEvent(OrgChartItem draggedItem, boolean fromClient)
      Parameters:
      draggedItem - the item being dragged.
    • addOnNodeClickListener

      public Registration addOnNodeClickListener(ComponentEventListener<OrgChart.NodeClickEvent> listener)
    • fireNodeClickEvent

      protected void fireNodeClickEvent(OrgChartItem clickedItem, boolean fromClient)
      Parameters:
      clickedItem - the item being clicked.
    • setCollapsedNodes

      public void setCollapsedNodes()
      Collapses all nodes except the root