src/ui/tree-view/smart-tree-view.component.ts
| changeDetection | ChangeDetectionStrategy.Eager |
| selector | smart-tree-view |
| styleUrls | ./smart-tree-view.component.css |
| templateUrl | ./smart-tree-view.component.html |
Properties |
|
Methods |
Inputs |
Outputs |
Accessors |
constructor(treeViewService: SmartTreeViewService, errorHandler: SmartErrorHandlerService, elementRef: ElementRef, renderer: Renderer2, changeDetector: ChangeDetectorRef, floatingWindowService: FloatingWindowHelperService, logger: SmartLoggerService, injector: Injector)
|
|||||||||||||||||||||||||||
|
Parameters :
|
| coordinated-slot-id |
Type : string
|
|
Optional id of a dynamic layout slot whose detail this tree drives when rendered as part of a tree-view form. When set, node selection is routed to the parent form's detail slot instead of this tree's nested detail form (SCLNG-1678). |
| disabled |
Type : boolean
|
| height |
Type : number
|
|
Sets the component height. |
| hide-detail-view |
Type : boolean
|
| max-height |
Type : number
|
|
Sets the component maximum height. |
| root-node-expanded |
Type : boolean
|
| root-node-type |
Type : string
|
|
Sets the root node type for the tree view. |
| smart-column-widths |
Type : string
|
| smart-main-column-header |
Type : string
|
| smart-pane-visibility |
Type : string
|
| ignoreFlexboxLayout |
Type : boolean
|
| smart-help-text |
Type : string | undefined
|
|
Sets the HelpText value for this form child. |
| smart-instance-name |
Type : string
|
|
The instance name of the component |
| smart-object-name |
Type : string
|
|
The object name of the component |
| nodeSelected |
Type : EventEmitter
|
|
Emits the selected node whenever the tree selection changes. |
| detailFormLoaded |
detailFormLoaded()
|
|
Returns :
void
|
| disableTreeView |
disableTreeView()
|
|
Returns :
void
|
| enableTreeView |
enableTreeView()
|
|
Returns :
void
|
| Public handleContextMenuClick | ||||||
handleContextMenuClick(menuItem: SmartTreeViewContextMenuItem)
|
||||||
|
Parameters :
Returns :
void
|
| Public handleLayoutChange | ||||||
handleLayoutChange(newLayout: any)
|
||||||
|
Parameters :
Returns :
void
|
| handleNodeRightClick | ||||||
handleNodeRightClick(node: any)
|
||||||
|
Parameters :
Returns :
void
|
| handleNodeSelection | ||||||
handleNodeSelection(node: SmartNode)
|
||||||
|
Parameters :
Returns :
void
|
| Public notifyLoadingFinished | ||||||
notifyLoadingFinished(objectName: string)
|
||||||
|
Notifies the parent Smart Form that this form child has finished loading
Parameters :
Returns :
void
void |
| Public busyNodeId |
Type : string
|
| console |
Type : unknown
|
Default value : console
|
| Public contextOffset |
Type : object
|
Default value : {
left: 0,
top: 0
}
|
| contextVisible |
Type : boolean
|
| detailForm |
Type : SmartFormComponent
|
Decorators :
@ViewChild(SmartFormComponent, {static: false, read: SmartFormComponent})
|
| Public floatingWindowService |
Type : FloatingWindowHelperService
|
Decorators :
@Optional()
|
| hasChildren |
Type : any
|
Default value : () => {...}
|
| loadChildren | ||
Type : unknown
|
||
Default value : () => {...}
|
||
|
Parameters :
|
| nodeContextMenu |
Type : SmartTreeViewContextMenuItem[]
|
Default value : []
|
| Public nodeLoading |
Type : boolean
|
| resizeHandles |
Type : QueryList<ResizeHandleDirective>
|
Decorators :
@ViewChildren(ResizeHandleDirective)
|
| Public injector |
Type : Injector
|
| rootNodeType | ||||||||
getrootNodeType()
|
||||||||
|
Returns the rootNodeType property value.
Returns :
string
|
||||||||
setrootNodeType(value: string)
|
||||||||
|
Sets the root node type for the tree view.
Parameters :
Returns :
void
|
| height | ||||||||
getheight()
|
||||||||
|
Returns the height property value.
Returns :
number
|
||||||||
setheight(value: number)
|
||||||||
|
Sets the component height.
Parameters :
Returns :
void
|
| maxHeight | ||||||||
getmaxHeight()
|
||||||||
|
Returns the maxHeight property value.
Returns :
number
|
||||||||
setmaxHeight(value: number)
|
||||||||
|
Sets the component maximum height.
Parameters :
Returns :
void
|
| visibility | ||||||
getvisibility()
|
||||||
|
Returns :
string
|
||||||
setvisibility(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| smartColumnWidths | ||||||
getsmartColumnWidths()
|
||||||
|
Returns :
string
|
||||||
setsmartColumnWidths(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| columnWidths |
getcolumnWidths()
|
|
|
| rootNodeExpandedByDefault | ||||||
getrootNodeExpandedByDefault()
|
||||||
|
Returns :
boolean
|
||||||
setrootNodeExpandedByDefault(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| columnHeadersStatic |
getcolumnHeadersStatic()
|
|
Returns :
string[]
|
| columnHeaders |
getcolumnHeaders()
|
|
Returns :
string[]
|
| rootNode | ||||||
getrootNode()
|
||||||
|
Returns :
SmartNode[]
|
||||||
setrootNode(value: SmartNode[])
|
||||||
|
Parameters :
Returns :
void
|
| splitViewOrientation | ||||||
getsplitViewOrientation()
|
||||||
|
Returns :
Orientation
|
||||||
setsplitViewOrientation(value: Orientation)
|
||||||
|
Parameters :
Returns :
void
|
| splitViewResponsiveOrientation | ||||||
getsplitViewResponsiveOrientation()
|
||||||
|
Returns :
any
|
||||||
setsplitViewResponsiveOrientation(value: any)
|
||||||
|
Parameters :
Returns :
void
|
| treeDisabled | ||||||
gettreeDisabled()
|
||||||
|
Returns :
boolean
|
||||||
settreeDisabled(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| hideDetailView | ||||||
gethideDetailView()
|
||||||
|
Returns :
boolean
|
||||||
sethideDetailView(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| mainColumnHeader | ||||||
getmainColumnHeader()
|
||||||
|
Returns :
string
|
||||||
setmainColumnHeader(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| selectedNode | ||||||
getselectedNode()
|
||||||
|
Returns :
SmartNode
|
||||||
setselectedNode(value: SmartNode)
|
||||||
|
Parameters :
Returns :
void
|
| detailView | ||||||
getdetailView()
|
||||||
|
Returns :
NodeDetailView
|
||||||
setdetailView(value: NodeDetailView)
|
||||||
|
Parameters :
Returns :
void
|
| treeTableComponent |
gettreeTableComponent()
|
|
Returns :
TreeListComponent
|
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**************************************************************************
--------------------------------------------------------------------------
File : smart-tree-view.component.html
Purpose : Template for Smart Tree View.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
--------------------------------------------------------------------------
-->
@if (!_hideDetailViewSignal()) {
<div class="h-100">
<smart-split-pane id="split-view" [visibility]="_visibilitySignal() || 'md,lg,xl'" [orientation]="_splitViewOrientationSignal()" [responsiveOrientation]="_splitViewResponsiveOrientationSignal()" [style.height]="'100%'">
<div left-pane class="col-12">
<smart-tree-list
[disabled]="_treeEffectiveDisabledSignal()"
[loadChildren]="loadChildren"
[style.height]="'100%'"
[style.display]="'block'"
[loading]="_rootNodeLoadingSignal()"
[rootNode]="_rootNodeSignal()"
[hasChildren]="hasChildren"
[selectedNode]="selectedNode"
[rootNodeExpandedByDefault]="_rootNodeExpandedByDefaultSignal() ?? true"
[columnHeadersStatic]="columnHeadersStatic"
[columnWidths]="_columnWidthsSignal()"
[mainColumnHeader]="_mainColumnHeaderSignal() || ''"
(onNodeSelection)="handleNodeSelection($event)"
(onContextMenuClick)="handleContextMenuClick($event)"
[items]="nodeContextMenu"
></smart-tree-list>
</div>
<div right-pane class="col-12">
<div #formContainer>
<smart-form
(viewLoaded)="detailFormLoaded()"
[smart-form-layout]="detailView && detailView.Template">
</smart-form>
</div>
</div>
</smart-split-pane>
</div>
} @else {
<div class="h-100">
<smart-tree-list
[disabled]="_treeEffectiveDisabledSignal()"
[loadChildren]="loadChildren"
[style.height]="'100%'"
[style.display]="'block'"
[loading]="_rootNodeLoadingSignal()"
[rootNode]="_rootNodeSignal()"
[hasChildren]="hasChildren"
[selectedNode]="selectedNode"
[rootNodeExpandedByDefault]="_rootNodeExpandedByDefaultSignal() ?? true"
[columnHeadersStatic]="columnHeadersStatic"
[columnWidths]="_columnWidthsSignal()"
[mainColumnHeader]="_mainColumnHeaderSignal() || ''"
(onNodeSelection)="handleNodeSelection($event)"
(onContextMenuClick)="handleContextMenuClick($event)"
[items]="nodeContextMenu"
></smart-tree-list>
</div>
}
./smart-tree-view.component.css
/**********************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**********************************************************************/
/*------------------------------------------------------------------------
File : smart-tree-view.component.css
Purpose : Styles for Smart Tree View.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
----------------------------------------------------------------------*/
::ng-deep .tree-column.intermediate {
border-left: 1px solid #D5D5D5 !important;
border-right: 1px solid #D5D5D5 !important;
}
::ng-deep .tree-column .number {
text-align: right !important
}
::ng-deep .disabled-overlay {
position: absolute;
background-color: lightgray;
opacity: 0.6;
/* height: 100%;
margin-left: 0px;
margin-top: 0px;*/
z-index: 9999
}
::ng-deep .context-menu-list,
.context-menu-item {
border-radius: 0px !important;
}
::ng-deep .context-menu-list {
margin: 0px !important
}
::ng-deep .context-menu-list p {
margin: 0px !important;
cursor: pointer !important;
}
::ng-deep .context-menu-item:hover {
background-color: lightgray;
text-decoration: none !important;
cursor: pointer !important;
}
::ng-deep .smart-tree-body-container>p-treetable>.ui-treetable.ui-widget>.ui-treetable-tablewrapper>table>thead>tr.ui-state-default {
display: none;
}
::ng-deep tbody.ui-treetable-data.ui-widget-content {
border: 0 transparent !important;
}
::ng-deep .smart-tree-body-container {
border-left: 1px solid #D5D5D5;
border-bottom: 1px solid #D5D5D5;
border-top: 0 transparent;
}
::ng-deep .resize-handle {
position: absolute;
margin-top: 0px;
margin-right: 0px;
bottom: 0;
width: 1px;
cursor: w-resize;
/* background: #D5D5D5; */
height: 28px;
}
::ng-deep .ui-contextmenu.hidden {
display: none !important;
}
::ng-deep .smart-tree-view-node-image {
margin-left: 10px;
}
::ng-deep .smart-tree-view-node-label {
margin-left: 8px;
}
::ng-deep .smart-tree-view-context-menu-container ul.k-menu {
z-index: 9999 !important;
}
::ng-deep smart-split-pane#split-view left-pane div,
::ng-deep smart-split-pane#split-view right-pane div {
padding: 0px !important;
}