I am trying to ensure that only leaf (child) nodes can be selected in the Kendo DropDownTree for Angular. If a parent node is clicked, the selection should be cleared and the input should display as empty (no value/placeholder).
What I am experiencing:
After selecting a child node (leaf), the value is set correctly.
If I later click a parent node, I set value = null
in the valueChange
event handler.
However, when I close and reopen the dialog containing the DropDownTree, the input always shows the last selected child (even though value
is null
).
The value for the input box is not showing null; the last valid child selection keeps coming back after reopening.
Summary of what I have tried:
Handled valueChange
to only accept leaf node selections and set value = null
for parents.
Verified that value
is null
when closing the dialog.
Expected behavior:
When a parent node is clicked, any selection should be cleared, and upon reopening the dialog, the DropDownTree input should remain empty (showing no last selection).
Actual behavior:
After clicking a parent and setting value = null
, closing and reopening the dialog always shows the last selected child in the DropDownTree input.
<mnp-dialog
class="feedback-dialog-wrapper"
[width]="width"
[height]="height"
[isOpen]="isOpen"
[title]="confirmationTitle"
(close)="close()">
<div class="feedback">
<div>{{ confirmationMessage }}</div>
<div class="k-form-field-wrap">
<kendo-dropdowntree
kendoDropDownTreeExpandable
[kendoDropDownTreeHierarchyBinding]="data"
childrenField="items"
textField="text"
valueField="id"
[valuePrimitive]="true"
[(value)]="value"
[filterable]="true"
(valueChange)="onValueChange($event)"
(close)="closeEvent($event)"
>
<ng-template kendoDropDownTreeValueTemplate let-dataItem>
<ng-container *ngIf="!dataItem?.items || dataItem?.items.length === 0">
<span class="template">{{ dataItem?.text }}</span>
</ng-container>
</ng-template>
<ng-template kendoDropDownTreeNodeTemplate let-dataItem let-index="index">
<span
[ngClass]="{
'parent-node': dataItem.items?.length > 0,
'child-node': !dataItem.items || dataItem.items.length === 0
}">
{{ dataItem.text }}
</span>
</ng-template>
</kendo-dropdowntree>
</div>
</div>
<kendo-dialog-actions>
<mnp-button id="confirmaion-cancel-btn" fillMode="outline" (click)="close()">{{
confirmationCancelBtn
}}</mnp-button>
<mnp-button id="confirmaion-submit-btn" [disabled]="value === null" (click)="submit()">{{ confirmationSubmitBtn }}</mnp-button>
</kendo-dialog-actions>
</mnp-dialog>
import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { TranslocoModule } from '@jsverse/transloco';
import { ActionsLayout, KENDO_DIALOGS } from '@progress/kendo-angular-dialog';
import { ButtonComponent, DialogComponent, LabelComponent } from '@mnp-firm-it/angular-ui-components';
import { KENDO_DROPDOWNS } from '@progress/kendo-angular-dropdowns';
import { KENDO_LABELS } from '@progress/kendo-angular-label';
import { HierarchicalItem } from '../../../models/contract-models';
@Component({
selector: 'app-manual-confirmation',
templateUrl: './manual-confirmation.component.html',
styleUrls: ['./manual-confirmation.component.scss'],
standalone: true,
encapsulation: ViewEncapsulation.None,
imports: [
CommonModule,
DialogComponent,
KENDO_DROPDOWNS,
KENDO_DIALOGS,
ButtonComponent,
TranslocoModule,
KENDO_LABELS
]
})
export class ManualConfirmationComponent {
@Input() actionsLayout: ActionsLayout = 'stretched';
@Input() isOpen = false;
@Input() confirmationTitle = 'title';
@Input() confirmationMessage = 'message';
@Input() confirmationCancelBtn = 'Cancel';
@Input() confirmationSubmitBtn = 'Submit';
@Input() data: HierarchicalItem[] = [];
@Input() width = '250';
@Input() height = '250';
@Output() closed = new EventEmitter<void>();
value: number | null = null;
@Output() submitted = new EventEmitter<boolean>();
close() {
this.value = null;
this.closed.emit();
this.submitted.emit(false);
}
submit() {
this.submitted.emit(true);
this.close();
}
onValueChange(selectedId: any) {
this.value = null;
const findItem = (items: any[]): any =>
items.reduce((acc, item) => {
if (item.id === selectedId) return item;
if (item.items) {
const found = findItem(item.items);
if (found) return found;
}
return acc;
}, null);
const selectedItem = findItem(this.data);
console.log('Selected Item:', selectedItem);
if (!selectedItem.items) {
this.value = selectedId;
} else {
console.log('iam here');
this.value = null;
}
}
closeEvent(event: any): void {
if (this.value === null) {
event.preventDefault();
}
}
}
Hey,
I tried to play around with the new Toolbar inside the Grid.
From the documentation I copied:
<kendo-grid<kendo-toolbar overflow="scroll">
<kendo-toolbar-button kendoGridFilterTool></kendo-toolbar-button>
<kendo-toolbar-button kendoGridSortTool></kendo-toolbar-button>
<kendo-toolbar-button kendoGridGroupTool></kendo-toolbar-button>
<kendo-toolbar-separator></kendo-toolbar-separator>
<kendo-toolbar-button kendoGridColumnChooserTool></kendo-toolbar-button>
<kendo-toolbar-spacer></kendo-toolbar-spacer>
<kendo-toolbar-button kendoGridPDFTool></kendo-toolbar-button>
<kendo-toolbar-button kendoGridExcelTool></kendo-toolbar-button>
</kendo-toolbar>
...
Sadly, I can't seem to get the first three directives (kendoGridFilterTool, kendoGridSortTool, kendoGridGroupTool) to work.
I'm in Webstorm which tells me: "Attribute kendoGridFilterTool is not allowed here".
Am I missing an import or something?
Please help.
I have two date series with different interval between timestamps, within the same time range. I'd like them to be lines with a gap instead of empty/missing values. The problem is, that to fulfil both requirements, I obviously need to create two axes - with different base unit step (otherwise one serie is continuous and the other is discrete).
As in this example: https://dojo.telerik.com/ZhgHEaJP
My question is whether there is a way how to 'merge' the two axes together to have just a single axis, as they are similar (except the base unit step), and to see the points at the same timestamp directly above.
Hi,
i tried to use kendo ui at angular V19, i got the below errors when i ran ng server:
X [ERROR] TS2322: Type 'readonly [typeof TextBoxDirective, typeof TextBoxComponent, typeof InputSeparatorComponent, typeof TextBoxSuffixTemplateDirective, ... 49 more ..., typeof OTPInputCustomMessagesComponent]' is not assignable to type 'any[] | Type$1<any> | ModuleWithProviders<{}>'.
The type 'readonly [typeof TextBoxDirective, typeof TextBoxComponent, typeof InputSeparatorComponent, typeof TextBoxSuffixTemplateDirective, ... 49 more ..., typeof OTPInputCustomMessagesComponent]' is 'readonly' and cannot be assigned to the mutable type 'any[]'. [plugin angular-compiler]
my package.json:
can you please help ?
I was previously setting primary, secondary, and error colors and then importing the all.scss from kendo-theme-material - it worked great.
Now, I'm trying to import the material-2.scss and most of the controls have styling issues, almost like it is still trying to render Material 3 styles which take up a lot more space.
If I want to import like this, am I doing something wrong, or is the material-2 scss simply not working yet?
We want to use "kendo-angular-pdfviewer" package with 13.0.0 version only as we have other exiting kendo packages with "11.6.0" version. If we use latest "kendo-angular-pdfviewer" packages ( which has able to customize pdf toolbar) then we need to change all other packages also which we are not willing to change now. In pdf viewer component, we want to display download button based on some conditions.
Please let us know if there is any way to acheive our requirement to display download button based on conditions and with out impacting other kendo packages.
<kendo-grid [selectable]="true" [kendoGridBinding]="[{name: 'bill', age: 55}]">
<kendo-grid-column field="name" title="Name"></kendo-grid-column>
<kendo-grid-column field="age" title="Age"></kendo-grid-column>
<ng-template kendoGridDetailTemplate>
<textarea rows="3"></textarea>
</ng-template>
</kendo-grid>
Angular v20 introduced the ability to go zonless with "provideZonelessChangeDetection" but the popup placement of kendoTooltip with zoneless is offset. If I add back the zone.js dependency then it works fine, but of course that's not ideal.
Code to reproduce is very simple:
<button kendoTooltip title="test tooltip">
hi there
</button>
or here's a code sandbox sample forked from the tooltip overview example
Would you please modify this to work with zoneless?
Thank You.