File

src/ui/toolbar/smart-toolbar.component.ts

Extends

AbstractFormChild

Implements

OnInit AfterViewInit OnDestroy ISSEHEnabledComponent ISSEHEnabledTableIOSource

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(registry: SmartToolbarRegistry, changeDetector: ChangeDetectorRef, toolbarInstanceService: SmartToolbarInstanceService, container: ViewContainerRef, injector: Injector, renderer: Renderer2, elementRef: ElementRef, cefsharpService: CefSharpService, vcRef: ViewContainerRef, errorHandler: SmartErrorHandlerService, logger: SmartLoggerService, smartFormInstanceService?: SmartFormInstanceService)
Parameters :
Name Type Optional
registry SmartToolbarRegistry No
changeDetector ChangeDetectorRef No
toolbarInstanceService SmartToolbarInstanceService No
container ViewContainerRef No
injector Injector No
renderer Renderer2 No
elementRef ElementRef No
cefsharpService CefSharpService No
vcRef ViewContainerRef No
errorHandler SmartErrorHandlerService No
logger SmartLoggerService No
smartFormInstanceService SmartFormInstanceService Yes

Inputs

disabled-buttons
Type : string

The names of the buttons that are or should be disabled by the toolbar.

responsive
Type : boolean

Sets whether the toolbar is responsive.

smart-event-handlers
Type : SSEHEventHandlerDefinitions

Sets the server-side event handler definitions.

smart-navigation
Type : boolean

If set to true, the toolbar will display the next and previous navigation buttons.

smart-toolbar-buttons
Type : string

A comma delimited list of buttons that the toolbar should display. Possible values: add, delete, cancel, save, copy

toolbarStyle
Type : any

Sets the toolbar style object.

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

Outputs

on-add
Type : EventEmitter<void>

Fires when the add button is clicked.

on-button-clicked
Type : EventEmitter<string>

Fires when any button is clicked.

on-cancel
Type : EventEmitter<void>

Fires when the cancel button is clicked.

on-copy
Type : EventEmitter<void>

Fires when the copy button is clicked.

on-delete
Type : EventEmitter<void>

Fires when the delete button is clicked.

on-export
Type : EventEmitter<SmartExportType>
on-next
Type : EventEmitter<void>

Fires when the next button is clicked.

on-previous
Type : EventEmitter<void>

Fires when the previous button is clicked.

on-save
Type : EventEmitter<void>

Fires when the save button is clicked.

on-update
Type : EventEmitter<void>

Fires when the update button is clicked.

on-view
Type : EventEmitter<void>
smart-active-export-target-changed
Type : ReplaySubject<string>

Emits a new value every time the Smart Toolbar's active export target has changed

smart-activeio-target-changed
Type : ReplaySubject<string>

Emits a new value every time the Smart Toolbar's active IO target has changed

Methods

Public activateSmartExportTarget
activateSmartExportTarget(target: string)

Sets the Smart Grid with the specified instance name as the Smart Toolbar's active export target

Parameters :
Name Type Optional Description
target string No

the instance name of the Smart Grid that is to become the activa export target

Returns : void
Public activateSmartTableIOTarget
activateSmartTableIOTarget(targetInstanceName: string)

Sets the Smart Viewer or Smart Grid with the specified instance name as the Smart Toolbar's active IO target

Parameters :
Name Type Optional Description
targetInstanceName string No

the instance name of the Smart Viewer or Smart Grid that is to become the active IO target

Returns : void
Public callLogicMethod
callLogicMethod(methodName: string, ...args: any[])

Calls a method on the logic class instances (delegates to parent form)

Parameters :
Name Type Optional Description
methodName string No
  • The method name to call
args any[] No
  • Arguments to pass to the method
Returns : Promise | any

The result of the method call

clickButton
clickButton(btn: string)

Fires the button with the specified name's corresponding button clicked event

Parameters :
Name Type Optional
btn string No
Returns : void
disableButton
disableButton(btn: string)

Disables the toolbar button with the given name, if it is displayed.

Parameters :
Name Type Optional
btn string No
Returns : void
disableButtons
disableButtons(btns: string[])

Disables the toolbar buttons specified in the given list, if they are displayed.

Parameters :
Name Type Optional
btns string[] No
Returns : void
disableExportTargetControls
disableExportTargetControls()

Disables all export controls

Returns : void
disableNonTableIOTargetControls
disableNonTableIOTargetControls()
Example :
Disables all toolbar buttons of type="command"
Returns : void
disableTableIOTargetControls
disableTableIOTargetControls()

Disables all table IO target controls

Returns : void
enableButton
enableButton(btn: string)

Enables the toolbar button with the given name, if it is displayed.

Parameters :
Name Type Optional
btn string No
Returns : void
enableButtons
enableButtons(btns?: string[])

Enables the toolbar buttons specified in the given list, if they are displayed. If no list is provided, all toolbar buttons are enabled.

Parameters :
Name Type Optional
btns string[] Yes
Returns : void
enableExportTargetControls
enableExportTargetControls()

Enables all export controls

Returns : void
enableNonTableIOTargetControls
enableNonTableIOTargetControls()

Enables all toolbar buttons of type="command"

Returns : void
enableTableIOTargetControls
enableTableIOTargetControls()

Enables all table IO target controls

Returns : void
getButtonControl
getButtonControl(btnName: string)

Returns the toolbar button control with the specified name

Parameters :
Name Type Optional
btnName string No
getComboControl
getComboControl(btnName: string)
Parameters :
Name Type Optional
btnName string No

SmartComboEditorComponent

Public getDataSource
getDataSource(dataSourceName?: string)

Returns the data source for the active IO target

Parameters :
Name Type Optional Description
dataSourceName string Yes
  • The data source name

The data source

Public getTableIOTarget
getTableIOTarget(instanceName: string)

Returns the table IO target with the specified instance name

Parameters :
Name Type Optional Default value Description
instanceName string No this._currentIOTarget
  • The instance name of the table IO target
Public handleLayoutChange
handleLayoutChange(newLayout: any)
Parameters :
Name Type Optional
newLayout any No
Returns : void
hasButton
hasButton(btn: string)

Returns true if the toolbar is currently displaying a button with the given name.

Parameters :
Name Type Optional
btn string No
Returns : boolean
initializeWithDatasource
initializeWithDatasource(datasource: AbstractSmartDataSource, ownerTargetName?: string)
Parameters :
Name Type Optional Description
datasource AbstractSmartDataSource No
ownerTargetName string Yes

the target that owns this binding

Returns : boolean
isDisabled
isDisabled(btn: string)

Returns true if the button with the given name is displayed and is disabled.

Parameters :
Name Type Optional
btn string No
Returns : boolean
popupMenuBlurred
popupMenuBlurred($event: unknown)
Parameters :
Name Type Optional
$event unknown No
Returns : void
popupMenuClicked
popupMenuClicked($event: unknown)
Parameters :
Name Type Optional
$event unknown No
Returns : void
popupMenuClosing
popupMenuClosing(event: PreventableEvent)
Parameters :
Name Type Optional
event PreventableEvent No
Returns : void
popupMenuFocused
popupMenuFocused($event: unknown)
Parameters :
Name Type Optional
$event unknown No
Returns : void
Public revalidateActiveIOTarget
revalidateActiveIOTarget()

Drops the active and possible TableIO targets that are no longer registered. Called when a dynamic layout slot is torn down so a newly rendered target can self-activate on this toolbar (SCLNG-1677). When another registered target remains, it is activated provisionally: a target registering afterwards (the slot's replacement content) takes the toolbar over from the fallback.

Returns : void
Public notifyLoadingFinished
notifyLoadingFinished(objectName: string)

Notifies the parent Smart Form that this form child has finished loading

Parameters :
Name Type Optional
objectName string No
Returns : void

void

Properties

contentInit
Type : unknown
Default value : false
contextUpdated
Type : EventEmitter<any>
Default value : new EventEmitter<any>()
controls
Type : QueryList<SmartToolbarButtonComponent | SmartToolbarSeparatorComponent | SmartToolbarComboButtonComponent | SmartToolbarCustomItemComponent>
Decorators :
@ContentChildren(SmartToolbarControlItem)
customItems
Type : QueryList<SmartToolbarItem>
Decorators :
@ContentChildren(SmartToolbarItem)
hamburgerMenuItems
Type : HamburgerMenuToolbarItem[]
Default value : []
itemRenderers
Type : QueryList<SmartToolbarItemRenderer>
Decorators :
@ContentChildren(SmartToolbarItemRenderer)
Public possibleExportTargets
Type : string[]
Default value : []

Possible export targets that have been registered with the Smart Toolbar

Public possibleIOTargets
Type : string[]
Default value : []

Possible IO targets that have been registered with the Smart Toolbar

separators
Type : QueryList<SmartToolbarSeparatorComponent>
Decorators :
@ContentChildren(SmartToolbarSeparatorComponent)
spacers
Type : QueryList<ToolBarSpacerComponent>
Decorators :
@ContentChildren(ToolBarSpacerComponent)
toolbarButtonControls
Type : QueryList<SmartToolbarButtonComponent>
Decorators :
@ContentChildren(SmartToolbarButtonComponent)
toolbarComboControls
Type : QueryList<SmartToolbarComboButtonComponent>
Decorators :
@ContentChildren(SmartToolbarComboButtonComponent)
toolbarComponent
Type : ToolBarComponent
Decorators :
@ViewChild(ToolBarComponent)
Public vcRef
Type : ViewContainerRef
Public injector
Type : Injector

Accessors

dropdownButton
getdropdownButton()
Returns : ElementRef
allControls
getallControls()
Returns : any[]
toolbarControls
gettoolbarControls()
Example :
    | SmartToolbarButtonComponent
    | SmartToolbarComboButtonComponent
    | SmartToolbarSeparatorComponent
    | SmartToolbarItemRenderer
 | ToolBarSpacerComponent
>)
nonTableIOTargetControls
getnonTableIOTargetControls()
tableIOTargetControls
gettableIOTargetControls()

Returns a list of all TableIO toolbar button controls

exportControls
getexportControls()

Returns a list of all export controls

overflownItems
getoverflownItems()
Returns : number
toolbarStyle
gettoolbarStyle()

Returns the toolbar style object.

Returns : any
settoolbarStyle(value: any)

Sets the toolbar style object.

Parameters :
Name Type Optional Description
value any No
  • The style object.
Returns : void
responsive
getresponsive()

Returns whether the toolbar is responsive.

Returns : boolean
setresponsive(value: boolean)

Sets whether the toolbar is responsive.

Parameters :
Name Type Optional Description
value boolean No
  • The responsive flag.
Returns : void
eventHandlers
geteventHandlers()

Returns the server-side event handler definitions.

seteventHandlers(value: SSEHEventHandlerDefinitions)

Sets the server-side event handler definitions.

Parameters :
Name Type Optional Description
value SSEHEventHandlerDefinitions No
  • The handler definitions.
Returns : void
hasUpdate
gethasUpdate()

Indicates whether the toolbar has an update button

Returns : boolean
hasAdd
gethasAdd()

Indicates whether the toolbar has an add button

Returns : boolean
hasSave
gethasSave()

Indicates whether the toolbar has a save button

Returns : boolean
hasCancel
gethasCancel()

Indicates whether the toolbar has a cancel button

Returns : boolean
hasDelete
gethasDelete()

Indicates whether the toolbar has a delete button

Returns : boolean
hasView
gethasView()
Returns : boolean
isAddDisabled
getisAddDisabled()

Indicates whether the toolbar's add button is disabled

Returns : boolean
isSaveDisabled
getisSaveDisabled()

Indicates whether the toolbar's save button is disabled

Returns : boolean
isCancelDisabled
getisCancelDisabled()

Indicates whether the toolbar's cancel button is disabled

Returns : boolean
isDeleteDisabled
getisDeleteDisabled()

Indicates whether the toolbar's delete button is disabled

Returns : boolean
isPreviousDisabled
getisPreviousDisabled()

Indicates whether the toolbar's previous button is disabled

Returns : boolean
isNextDisabled
getisNextDisabled()

Indicates whether the toolbar's next button is disabled

Returns : boolean
isViewDisabled
getisViewDisabled()
Returns : boolean
isUpdateDisabled
getisUpdateDisabled()
Returns : boolean
hasCopy
gethasCopy()

Indicates whether the toolbar has a copy button

Returns : boolean
isCopyDisabled
getisCopyDisabled()

Indicates whether the toolbar's copy button is disabled

Returns : boolean
buttons
setbuttons(value: string)

A comma delimited list of buttons that the toolbar should display. Possible values: add, delete, cancel, save, copy

Parameters :
Name Type Optional
value string No
Returns : void
navigation
getnavigation()

Returns whether the toolbar displays navigation buttons.

Returns : boolean
setnavigation(value: boolean)

If set to true, the toolbar will display the next and previous navigation buttons.

Parameters :
Name Type Optional Description
value boolean No
  • Whether navigation buttons are displayed.
Returns : void
toolbarButtons
gettoolbarButtons()

A list of the names of the buttons displayed by the toolbar

Returns : string[]
buttonWidthClass
getbuttonWidthClass()

The appropriate bootstrap grid layout CSS class that should be applied to the toolbar buttons. The value is obtained by dividing the total number of grid layout columns (12) by the number of buttons that are displayed. e.g. if the toolbar is displaying the add, save, delete and cancel buttons, the value would be 'col-3' since 12 / 4 = 3.

Returns : string
activeIOTarget
getactiveIOTarget()

The instance name of the Smart Viewer or Smart Grid representing the current IO target

Returns : string
activeExportTarget
getactiveExportTarget()

The instance name of the Smart Grid representing the current export target

Returns : string
disabledButtons
getdisabledButtons()

Returns the names of disabled buttons as a comma-delimited string.

Returns : string
setdisabledButtons(value: string)

The names of the buttons that are or should be disabled by the toolbar.

Parameters :
Name Type Optional
value string No
Returns : void
isCefsharp
getisCefsharp()

Returns whether CefSharp is available.

Returns : boolean
setisCefsharp(value: boolean)

Sets whether CefSharp is available.

Parameters :
Name Type Optional Description
value boolean No
  • The CefSharp flag.
Returns : void
popupAppendTarget
getpopupAppendTarget()

Returns the container where toolbar popups should be appended.

Returns : "root" | ViewContainerRef
<!--
**************************************************************************
* 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-toolbar.component.html
    Purpose     : Template for Smart Toolbar.
    Author(s)   : Radu Nicoara
    Created     : Dec 07, 2017
--------------------------------------------------------------------------
-->
<div class="smart-toolbar-wrap" [class.cefsharp]="cefsharpToolbarIntegrationEnabled() && _isCefsharpSignal()">
    <ng-content></ng-content>
    @if (_navigationSignal()) {
    <smart-toolbar-button role="previous" class="me-1"></smart-toolbar-button>
    <smart-toolbar-button role="next" class="me-2"></smart-toolbar-button>
    }
    <div #containerRef class="w-100">
        <kendo-toolbar
            class="toolbar-wrapper"
            [class.cefsharp]="_isCefsharpSignal()"
            [ngStyle]="_toolbarStyleSignal()"
            [overflow]="true"
            [popupSettings]="{ appendTo: popupAppendTarget, popupClass: 'smart-toolbar-popup' }">
            @for( control of controlsInDomOrder(); track control.control; let idx = $index) {
                @if (control.isSpacer) {
                    <kendo-toolbar-spacer></kendo-toolbar-spacer>
                }
                @else {
                    <smart-toolbar-control
                        [isLast]="idx === controlsInDomOrder().length - 1"
                        [isLastVisible]="idx === controlsInDomOrder().length - overflownItems - 1"
                        [sourceControl]="control.control">
                    </smart-toolbar-control>
                }
            }
        </kendo-toolbar>
    </div>
</div>

./smart-toolbar.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-toolbar.component.css
    Purpose     : Styles for Smart Toolbar.
    Author(s)   : Radu Nicoara
    Created     : Dec 07, 2017
  ----------------------------------------------------------------------*/

::ng-deep .smart-toolbar-separator {
	float: left;
	border-left: 1px solid var(--kendo-color-border, #d7d2d0);
	height: var(--kendo-spacing-7, 1.75rem);
}

::ng-deep .is-popup .smart-toolbar-separator {
	border-left: none !important;
	border-top: 1px solid var(--kendo-color-border, #d7d2d0);
	width: 100% !important;
	min-height: unset !important;
	height: 0px !important;
}

::ng-deep .combo-btn-wrap.is-popup {
    flex: 1;
}

::ng-deep .smart-combo-button {
	min-height: var(--kendo-spacing-7, 1.75rem);
}

::ng-deep .smart-combo-button.last {
	margin-right: 0 !important;
}

::ng-deep .smart-toolbar-item {
	float: left;
	margin-right: var(--kendo-spacing-1, 0.25rem);
}

::ng-deep .toolbar-wrapper.row {
	margin-left: 0 !important;
	margin-right: 0 !important;
	height: inherit !important;
}

::ng-deep .smart-toolbar-item,
::ng-deep .smart-toolbar-button {
	min-height: var(--kendo-spacing-7, 1.75rem);
}

/* Ensure consistent button sizing to prevent layout shifts */
::ng-deep .smart-toolbar-button {
	padding: var(--kendo-spacing-1, 0.25rem) var(--kendo-spacing-2, 0.5rem) !important;
	min-width: auto !important;
	white-space: nowrap !important;
}

::ng-deep .toolbar-wrapper .smart-toolbar-button {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

::ng-deep .toolbar-wrapper.k-toolbar {
	box-shadow: none !important;
	background-color: var(--kendo-toolbar-background, var(--kendo-color-surface, #ffffff));
	border: 1px solid var(--kendo-color-border, #d7d2d0);
	border-radius: var(--kendo-border-radius-md, 0.25rem);
}

::ng-deep .smart-toolbar-item.last {
	margin-right: 0 !important;
}

::ng-deep .toolbar-wrapper li.k-item {
	z-index: auto !important;
}

::ng-deep .smart-toolbar-menu-item {
	display: block;
	padding: var(--kendo-spacing-1, 0.25rem) var(--kendo-spacing-5, 1.25rem);
	clear: both;
	font-weight: var(--kendo-font-weight-normal, 400);
	line-height: var(--kendo-line-height-sm, 1.2);
	color: var(--kendo-color-on-app-surface, #3d3d3d);
	white-space: nowrap;
	border-radius: var(--kendo-border-radius-sm, 0.125rem);
}

::ng-deep .smart-toolbar-menu-item:hover {
	background-color: var(--kendo-color-base-hover, #f5f5f5);
	color: var(--kendo-color-on-app-surface, #3d3d3d);
}

::ng-deep ToolbarDropDownControl * .smart-toolbar-item {
	width: 100% !important;
}

::ng-deep ToolbarDropDownControl * button.smart-toolbar-item {
	text-align: left !important;
}

.smart-toolbar-button.dropdown-toggle {
	width: var(--kendo-spacing-7, 1.75rem);
}

::ng-deep kendo-popup .k-popup {
	width: initial !important;
	background-color: var(--kendo-color-surface, #ffffff);
	border: 1px solid var(--kendo-color-border, #d7d2d0);
	box-shadow: var(--kendo-elevation-4, 0 4px 6px rgba(0, 0, 0, 0.1));
}

::ng-deep kendo-popup button.is-popup {
	text-align: center !important;
}

.resizeable-container {
	width: 100%;
}

.smart-toolbar-wrap.cefsharp {
	display: none !important;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""