src/ui/grid/grid-edit-cell/smart-grid-edit-cell.component.ts
Component for rendering edit cells in the Smart Grid
| changeDetection | ChangeDetectionStrategy.OnPush |
| encapsulation | ViewEncapsulation.None |
| selector | smart-grid-edit-cell |
| styleUrls | ./smart-grid-edit-cell.component.scss |
| templateUrl | ./smart-grid-edit-cell.component.html |
Properties |
|
Methods |
Inputs |
| column |
Type : any
|
| Required : true |
|
Column configuration |
| dataItem |
Type : any
|
|
Data item being edited |
| dataSource |
Type : AbstractSmartDataSource
|
|
Data source for the grid |
| formGroup |
Type : FormGroup
|
|
Form group for the edit row |
| showDateTimeZone |
Default value : true
|
|
Whether DATETIME-TZ timezone badges/selectors are displayed. |
| useDateTimeZones |
Default value : true
|
|
Whether DATETIME-TZ editor offset handling should be used. |
| getDateTimeTZFormat |
getDateTimeTZFormat()
|
|
Gets the DATETIME-TZ picker format.
Returns :
string
|
| getDateTimeTZPickerValue |
getDateTimeTZPickerValue()
|
|
Gets the DATETIME-TZ picker value.
Returns :
Date | null
|
| getSelectedTimeZoneOffset |
getSelectedTimeZoneOffset()
|
|
Gets the selected timezone offset.
Returns :
string
|
| getTimeZoneOptions |
getTimeZoneOptions()
|
|
Gets timezone offset selector options.
Returns :
SmartDateTimeTZOffsetOption[]
|
| isEditorEnabled |
isEditorEnabled()
|
|
Returns whether the current editor control is enabled.
Returns :
boolean
True when the editor control is enabled. |
| shouldRenderTimeZoneSelector |
shouldRenderTimeZoneSelector()
|
|
Determines whether the timezone selector should be rendered.
Returns :
boolean
|
| shouldUseDateTimeTZPicker |
shouldUseDateTimeTZPicker()
|
|
Determines whether the DATETIME-TZ editor should use a datetime picker.
Returns :
boolean
|
| shouldUseDateTimeZones |
shouldUseDateTimeZones()
|
|
Determines whether DATETIME-TZ offset handling should be used.
Returns :
boolean
|
| updateDateTimeTZOffset | ||||||||
updateDateTimeTZOffset(offset: string)
|
||||||||
|
Updates the selected DATETIME-TZ offset.
Parameters :
Returns :
void
|
| updateDateTimeTZValue | ||||||||
updateDateTimeTZValue(value: Date)
|
||||||||
|
Updates a DATETIME-TZ date value from the picker.
Parameters :
Returns :
void
|
| updateLookupKeyValue | ||||||
updateLookupKeyValue(value: any)
|
||||||
|
Updates the key value of the given lookup column
Parameters :
Returns :
void
|
| updateValue | ||||||
updateValue(value: any)
|
||||||
|
Updates the value of the given column in the current form group
Parameters :
Returns :
void
|
| Readonly isNumericLookup |
Type : unknown
|
Default value : computed(() => isNumericColumn(this.column()))
|
|
Computed signal that identifies numeric lookup columns. |
| Readonly lookupValue |
Type : unknown
|
Default value : computed(() => this.dataSource()?.selected)
|
|
Computed signal for the lookup value from the data source |
<!--
**************************************************************************
* 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-grid-edit-cell.component.html
Purpose : Template for Smart Grid Edit Cell.
Author(s) : Radu Nicoara
Created : Nov 14, 2025
--------------------------------------------------------------------------
-->
@switch (editInputType()) { @case ('dateTimeTZ') {
<div class="smart-grid-datetime-tz-editor">
@if (!shouldUseDateTimeTZPicker()) {
<kendo-datepicker
[attr.name]="column().field"
[format]="getDateTimeTZFormat()"
[value]="getDateTimeTZPickerValue()"
[disabled]="!isEditorEnabled()"
(valueChange)="updateDateTimeTZValue($event)"
>
</kendo-datepicker>
} @else {
<kendo-datetimepicker
[attr.name]="column().field"
[format]="getDateTimeTZFormat()"
[value]="getDateTimeTZPickerValue()"
[calendarType]="'infinite'"
[disabled]="!isEditorEnabled()"
(valueChange)="updateDateTimeTZValue($event)"
>
</kendo-datetimepicker>
} @if (shouldRenderTimeZoneSelector()) {
<kendo-dropdownlist
class="smart-grid-datetime-tz-selector"
[data]="getTimeZoneOptions()"
textField="text"
valueField="value"
[valuePrimitive]="true"
[value]="getSelectedTimeZoneOffset()"
[disabled]="!isEditorEnabled()"
(valueChange)="updateDateTimeTZOffset($event)"
>
</kendo-dropdownlist>
}
</div>
} @case ('lookup') {
<smart-lookup
[selected]="lookupValue()"
[name]="column().field"
#vLookupField
smart-widget
[componentInstance]="vLookupField"
[enabled]="isEditorEnabled()"
[dataRequested]="column().editor.lookupOptions.dataRequestedHandler"
[smart-partial-dataset]="column().editor.lookupOptions.partialDataset"
[smart-lookup-key-value-field]="column().editor.lookupOptions.keyValueField"
[smart-lookup-key-value-field-binding]="
column().editor.lookupOptions.keyValueFieldBinding
"
[smart-lookup-header]="column().editor.lookupOptions.dialogTitle"
[smart-lookup-key-field]="column().editor.lookupOptions.keyField"
[smart-lookup-key-field-binding]="
column().editor.lookupOptions.keyFieldBinding
"
[smart-entity-table]="column().editor.lookupOptions.entityTable"
[smart-business-entity-name]="column().editor.lookupOptions.entityName"
[smart-grid-layout]="column().editor.lookupOptions.gridLayout"
[smart-lookup-fields]="column().editor.lookupOptions.fields"
[smart-lookup-fields-binding]="column().editor.lookupOptions.fieldBinding"
[smart-lookup-disable-autocomplete]="
column().editor.lookupOptions.disableAutocomplete
"
[smart-server-side-filtering]="
column().editor.lookupOptions.serverSideFiltering
"
[smart-server-side-sorting]="
column().editor.lookupOptions.serverSideSorting
"
(smartModelChange)="updateValue($event)"
(keyValueModelChange)="updateLookupKeyValue($event)"
[smartModel]="lookupModel()"
[numeric]="isNumericLookup()"
[ngStyle]="column().editor.style"
[smart-lookup-dialog-options]="column().editor.lookupOptions.dialogOptions"
[smart-filter]="column().editor.lookupOptions.smartFilter"
[smart-foreign-fields]="column().editor.lookupOptions.foreignFields"
[smart-lookup-query-string]="
column().editor.lookupOptions.lookupQueryString
"
[smart-lookup-dialog-query-string]="
column().editor.lookupOptions.lookupDialogQueryString
"
[provide-foreign-field-value]="
column().editor.lookupOptions.provideForeignFieldValue
"
[smart-viewer-unbound-field]="column().editor.unbound"
[smart-help-url]="column().editor.helpUrl"
[smart-fetch-data-on-navigate]="
column().editor.lookupOptions.fetchDataOnNavigate
"
[smart-fetch-data-from-key-value-on-navigate]="
column().editor.lookupOptions.fetchDataFromKeyValueOnNavigate
"
[ngClass]="{ 'has-help-url': column().editor.helpUrl }"
></smart-lookup>
} @case ('combo') {
<smart-combo-editor
#vCmbField
smart-widget
[componentInstance]="vCmbField"
[name]="column().field"
[enabled]="isEditorEnabled()"
[smart-value-list]="column().editor.comboOptions?.smartValueList || null"
[value-list-pair]="column().editor.comboOptions?.valueListPair || null"
[value-list]="column().editor.comboOptions?.valueList || null"
[smart-business-entity-name]="
$safeNavigationMigration(column().editor.comboOptions?.entityName)
"
[smart-entity-table]="
$safeNavigationMigration(column().editor.comboOptions?.tableRef)
"
[smart-partial-dataset]="
$safeNavigationMigration(column().editor.comboOptions?.partialDataset)
"
[image-field-name]="
$safeNavigationMigration(column().editor.comboOptions?.imageField)
"
[image-substitute]="
$safeNavigationMigration(column().editor.comboOptions?.imageSubstitute)
"
[display-column-name]="
$safeNavigationMigration(column().editor.comboOptions?.displayColumn)
"
[display-fields]="
$safeNavigationMigration(column().editor.comboOptions?.displayFields)
"
[display-substitute]="
$safeNavigationMigration(
column().editor.comboOptions?.displaySubstitute
)
"
[key-column-name]="
$safeNavigationMigration(column().editor.comboOptions?.keyColumn)
"
[smart-field-binding]="
$safeNavigationMigration(column().editor.comboOptions?.fieldBinding)
"
[smartModel]="comboModel()"
(smartModelChange)="updateValue($event)"
[smart-flag-value]="
column().editor.comboOptions?.flagValue === ''
? ''
: column().editor.comboOptions?.flagValue || null
"
[smart-flag-label]="column().editor.comboOptions?.flagLabel || null"
[smart-flag-image]="column().editor.comboOptions?.flagImage || null"
[smart-foreign-fields]="
$safeNavigationMigration(column().editor.comboOptions?.foreignFields)
"
[smart-query-string]="
$safeNavigationMigration(column().editor.comboOptions?.queryString)
"
[provide-foreign-field-value]="
$safeNavigationMigration(
column().editor.comboOptions?.provideForeignFieldValue
)
"
[smart-combo-allow-filter]="
$safeNavigationMigration(column().editor.comboOptions?.allowFiltering)
"
[smart-limit-to-list]="
$safeNavigationMigration(column().editor.comboOptions?.limitToList)
"
[autoCompleteMode]="
$safeNavigationMigration(column().editor.comboOptions?.autoCompleteMode)
"
[autoSuggestFilterMode]="
$safeNavigationMigration(
column().editor.comboOptions?.autoSuggestFilterMode
)
"
[smart-help-url]="column().editor.helpUrl"
[smart-value-list-display-text]="
$safeNavigationMigration(
column().editor.comboOptions?.valueListDisplayText
)
"
[ngStyle]="column().editor.style"
></smart-combo-editor>
} }
./smart-grid-edit-cell.component.scss
/**********************************************************************
* 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-grid-edit-cell.component.scss
Purpose : Styles for Smart Grid Edit Cell.
Author(s) : Radu Nicoara
Created : May 21, 2026
----------------------------------------------------------------------*/
.smart-grid-datetime-tz-editor {
display: grid;
grid-template-columns: minmax(0, 1fr) max-content;
align-items: stretch;
column-gap: var(--kendo-spacing-1, 0.25rem);
width: 100%;
min-width: 0;
white-space: nowrap;
}
.smart-grid-datetime-tz-editor kendo-datepicker,
.smart-grid-datetime-tz-editor kendo-datetimepicker {
width: 100%;
min-width: 0;
}
.smart-grid-datetime-tz-editor kendo-datepicker .k-input,
.smart-grid-datetime-tz-editor kendo-datetimepicker .k-input,
.smart-grid-datetime-tz-editor kendo-datepicker .k-picker,
.smart-grid-datetime-tz-editor kendo-datetimepicker .k-picker {
width: 100%;
min-width: 0;
}
.smart-grid-datetime-tz-editor .smart-grid-datetime-tz-selector {
width: 4.75rem;
min-width: 4.75rem;
}