Telerik Forums
Kendo UI for Angular Forum
1 answer
3.2K+ views

Good day,

I am presenting data in a grid, either as a date, time or date/time. When we export to Excel, it is defaulting all to the same date format. I would like to override the format for the times when exporting. I have dug through the code and found that if I add a format: "h:mm" to the data object in the ExcelExportEvent.workbook.sheets.rows.cells it does work as I want.

The issue is that the ExcelExportEvent columns definition does not include the data needed to go back and look at my original data to look up the right format. I need the field name so i can look up the format to apply, and then line up the column indices, etc.

For example, in this image you see the columns only contain width and autoWidth. Of course some columns may be hidden, so I cannot use the indices directly.

I am hoping perhaps there is a way I can add properties to the Grid Column which are picked up by the Excel export.

Thank you for your time!

Martin Bechev
Telerik team
 answered on 07 Jun 2021
1 answer
825 views

Hi,

I want to use the hierarchical drawer example, but I want that parents cannot be selected, only children (leafs) can be selected.

At this moment I am using the hierarchical drawer from the How to section on the kendo UI website, but this allows to select parent items.

This is my item template:

  <ng-template kendoDrawerItemTemplate let-item>
    <div class="k-drawer-link k-drawer-item-level-{{item.level ?? 0}}" [class.k-state-selected-child] = "item.selected && (item.children?.length ?? 0) == 0" [class.k-state-selected-parent] = "item.selected && (item.children?.length ?? 0) > 0">
      <span class="k-icon pr-2" [ngClass]="item.icon"></span>
      <span class="k-drawer-item-level-{{item.level ?? 0}}-text" *ngIf="drawer.expanded && item.translationId" [translate]="item.translationId"></span>
      <span class="k-drawer-item-level-{{item.level ?? 0}}-text" *ngIf="drawer.expanded && !item.translationId">{{ item.text }}</span>
      <span *ngIf="item.expanded && item.children?.length > 0" class="k-icon k-i-arrow-chevron-down" style="margin-left: auto;"></span>
      <span *ngIf="!item.expanded && item.children?.length > 0" class="k-icon k-i-arrow-chevron-right arrow-left" style="margin-left: auto"></span>
    </div>
  </ng-template>

 

(At this moment we are faking the background of the parent items to be white (k-state-selected-parent), but the selected property is still true behind the scenes.)

=> I have troubles, when drawer item 1 is selected, and I expand drawer item 2, the selection dissappear on drawer item 1, because drawer item 2 is selected and expanded. It should only be possible to select drawer item 2.1 or 2.2 (for example) or in other words: expanding a parent may not lead to selection of that parent (to prevent losing the last selected item)

How to achieve this behavior?

 

thx

Georgi
Telerik team
 answered on 07 Jun 2021
1 answer
176 views

Hello everyone!

I am using in a project the kendo-chart donut component and I would like to rise the same click event programmatically in a legend as a filter. Is it possible to do in a .TS file? 

In the image is possible to see the donut with legend that I use like a filter. I have the same legends description in a combobox and when my costumers change the combobox, it should change the donut here.  

Hetali
Telerik team
 answered on 03 Jun 2021
1 answer
616 views

Hello Kendo UI Team,

The dataStateChange and the filterChange events are not emitting anything on changing the filter value when -
- I'm using it on a mobile device (tested on android 10 and 11)
- the column's filter type is "text"

Here is the column's definition:

{
    field: `name`,
    title: `Name`,
    filter: {
      type: `text`
    }
}

The example provided on kendo's official page, which has text type column in the grid, is not working on the mobile device also if I change the filter value. Here is the grid I've checked on android 10 and 11. Official Page's Grid Demo

But it works fine if the filter type is numeric/date/dropdown/et cetera. It also works fine on changing sort or paging.

I have searched for any workaround for this but unfortunately could not find anything. It would be helpful if you can suggest any workaround. Please also If there is no workaround available

Yanmario
Telerik team
 answered on 02 Jun 2021
1 answer
817 views

Hi,

I have this grid markup with auto generated columns by ngFor. Also I have checkbox column. But I need to make checkbox by default sticky (locked) and this will throw error.

Thank you for your time.

GridComponent.html:5 ERROR Error: There should be at least one non-locked column
    at GridComponent.verifySettings (index.js:7712)
    at GridComponent.ngAfterContentChecked (index.js:6992)
    at callProviderLifecycles (core.js:24917)
    at callElementProvidersLifecycles (core.js:24886)
    at callLifecycleHooksChildrenFirst (core.js:24868)
    at checkAndUpdateView (core.js:35072)
    at callViewAction (core.js:35433)
    at execComponentViewsAction (core.js:35361)
    at checkAndUpdateView (core.js:35074)
    at callViewAction (core.js:35433)

<!-- Checkbox -->
<kendo-grid-checkbox-column
	[width]="checkboxColumnSize"
	[style]="{ 'text-align': 'center' }"
        Error -> [locked]="true" or [sticky]="true
>
	<ng-template kendoGridHeaderTemplate>
		<!-- Columns Menu -->
		<ca-toggle-popup
			class="grid-columns-menu"
			#showColumnsMenu
			(toggle)="onShowColumnsMenu($event)"
		>
			<button
				button
				kendoButton
				class="columns-menu-button"
				iconClass="fal fa-cog"
				look="clear"
				kendoTooltip
				position="right"
				title="Settings"
			></button>
			<div popup>
				<div class="columns-menu-header">
					<span>Grid Columns</span>
				</div>
				<ca-switch-lists
					#switchColumns
					[keyField]="'field'"
					[textField]="'title'"
					[maxSelected]="maxSwitchColumns"
					[availableData]="availableColumns"
					[selectedData]="selectedColumns"
					class="columns-menu-switchlist"
				></ca-switch-lists>
				<div class="columns-menu-actions">
					<button
						kendoButton
						(click)="onCancelColumnsMenu(showColumnsMenu)"
					>
						Cancel
					</button>
					<button
						kendoButton
						[primary]="true"
						(click)="
							onApplyColumnsMenu(
								showColumnsMenu,
								switchColumns.selectedData
							)
						"
						[disabled]="!switchColumns.selectedData?.length"
					>
						Apply ({{ switchColumns.selectedData?.length || 0 }}/{{
							maxSwitchColumns
						}})
					</button>
				</div>
			</div>
		</ca-toggle-popup>
	</ng-template>
</kendo-grid-checkbox-column>
<!-- Columns -->
<kendo-grid-column
	*ngFor="let column of columns; let i = index"
	[field]="column.field"
	[title]="column.title"
	[width]="getColumnWidth | apply: i:column.field:defaultColumnSize"
	[filter]="filterColumn | apply: column.type"
	[locked]="lockColumn | apply: column.field"
	[style]="{
		'min-width': minColumnSize + 'px',
		'max-width': maxColumnSize + 'px'
	}"
>
	<!-- Column Header -->
	<ng-template kendoGridHeaderTemplate let-column>
		<!-- Cell Value -->
		<span class="k-flex">{{ column.title }}</span>
		<!-- Cell Menu -->
		<kendo-grid-column-menu
			*ngIf="!hasMore"
			[column]="column"
			[sort]="state.sort"
			[filter]="state.filter"
			[settings]="{
				sort: true,
				filter: true,
				lock: true,
				columnChooser: false
			}"
		>
		</kendo-grid-column-menu>
	</ng-template>
	<!-- Cell Item -->
	<ng-template kendoGridCellTemplate let-dataItem>
		<span class="grid-cell">{{
			editCell | apply: column:dataItem[column.field]
		}}</span>
	</ng-template>
</kendo-grid-column>

Yanmario
Telerik team
 answered on 02 Jun 2021
2 answers
672 views

Hi,

I have problems in using the Grid inside an Angular project with strict mode on.

<kendo-grid
      [data]="view | async"
      [loading]="view.loading"
      [pageSize]="state.take"
      [skip]="state.skip"
      [sort]="state.sort"

It complains that pageSize, skip and sort can't accept undefined values while the underlying State object can.

Thanks!

Svet
Telerik team
 answered on 02 Jun 2021
1 answer
830 views

Hello, 

when using customized filter menus (as explained in the following) is there any way to customize the appearance of the popup that is displayed especially the buttons that are placed inside the popup as seen in the screenshot below? (In this case `Clear` and `Filter`)

I know that the text can be customized by using the CustomMessagesComponent. But what if I want to place my own buttons or remove them? I have found the following answer from 2019 that there is only the functionality to style them but only inside the styles property from the component that uses the kendo grid component. 

Version Information

"@progress/kendo-theme-default": "^4.38.1",

"@progress/kendo-angular-grid": "^5.0.2",

Thanks in advance for any help or information. 

 

Yanmario
Telerik team
 answered on 01 Jun 2021
1 answer
216 views

Hi,

When the user select a date I have to add a list of date preset near the calendar, how can i do it?

Svet
Telerik team
 answered on 01 Jun 2021
2 answers
641 views

I have a sidebar menu with a panelbar and i use the routerlink to navigate to components.

When i click a panelbar item the background changed - class k-state-selected was added. Can i prevent that?

Michael
Top achievements
Rank 1
Veteran
Iron
 answered on 31 May 2021
1 answer
1.7K+ views
hey team

 

I am facing another issue, that when a user clicks on a node in kendo treeview, onnodeclick event gets triggered. In its event handler, how can we get the parent nodes of that node?

 




 

Yanmario
Telerik team
 answered on 28 May 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?