Telerik Forums
Kendo UI for Angular Forum
1 answer
20 views

Hello,
I'm using the kendo-grid for angular and in a colum I have date format.

<kendo-grid-column
        field="toDate"
        title="A"
        [width]=160
        [format]=displayDateFormat
        filter="date"
        [style]="{ 'border': '1px solid #888' }"
        >
        <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
          <kendo-grid-date-filter-cell
            [operator]="'lte'"
            [showOperators]="false"
            [column]="column"
            [filter]="filter"
            [formatPlaceholder]="{
              year: 'aaaa', month: 'MM', day: 'gg',
              hour: 'h', minute: 'm', second: 's', millisecond: ''
            }"
          ></kendo-grid-date-filter-cell>
        </ng-template>
            <ng-template kendoGridCellTemplate let-dataItem>
                {{dataItem.toDate | date: displayDateFormat}}
            </ng-template>
        </kendo-grid-column>

 

The only possible option for the filter is less than equal (<=) the problem is who the filter work like lt (<) and not consider equal value.

If i selecet the filter date 31/01/2024 (in italy whw use dd/MM/yyyy) the grid show only data to 30/01/2024.

The same configuration using 'gte' work fine.

Thanks

LSo

 

 

Martin Bechev
Telerik team
 answered on 12 Jan 2024
1 answer
44 views

I would like to open a grid like this (without manually dragging the header):

In other words, using this example, I would like to group by Name whenever the grid loads.

II have the grid configured like this in the html file:

    kendoGridExpandGroupBy = "groups"
    [(expandedGroupKeys)] = "groups" 

 

And I have tried this in the component.ts file:
    groupBy(this.groups, this.groups);But I think the GroupBy works on the data query and not on the grid.

Is there a way to do what I am trying to accomplish?

Thanks for any help or pointers.

Zornitsa
Telerik team
 answered on 11 Jan 2024
2 answers
44 views

Hi!

i want replace a input text with a dropdownlist-filter inside this default filter, i need to keep this filter: CONTAINS ... - AND / OR - CONTAINS ...

Can someone help me?

Thanks!! 

Andrea
Top achievements
Rank 1
Iron
 answered on 10 Jan 2024
0 answers
25 views
hi, I have a column with multiple object values ​​and I need to bind each id to default filter menu but kendo only allows me to bind an unique id via input (fieldName).
Is there a way to send multiple ids? or i have to create a custom component and add my logic there
marc
Top achievements
Rank 1
 asked on 09 Jan 2024
1 answer
29 views

When I select the "selectAll" checkbox, only the quantity number from the "pageSize" property is selected. When I scroll through the grid, the new visible rows are not selected and the previous rows are no longer selected.

Here is an example of a stackblitz:

https://stackblitz.com/edit/angular-tybn6w?file=src%2Fapp%2Fapp.component.ts

Martin Bechev
Telerik team
 answered on 08 Jan 2024
1 answer
37 views

Hi,

you have the kendoGridInCellEditing, which is very handy. I use it in my project. But I have one issue with it. As per declaration if I click on a simple grid cell, the directive sets the clicked cell in edit mode. How can I prevent this?

 
horváth
Top achievements
Rank 2
Iron
Iron
 answered on 05 Jan 2024
0 answers
27 views

Hi, 

please help to set k-selected class on expand/collapse event in treeList (angular 16 app).

By default rows are highlighted on select event (k-selected class applied), but I need to highlight it on expand, collapse, select events.

I was trying to use rowCallback for setting/removing selected class and expand/collapse events for getting selected row id, but currently several rows are staying selected at the same time when should be selected only one (from the last action). Am I missing something, or is there a better approach?

rowCallback = (context) => {
return this.zone.run(() => {
if (context.dataItem.id === this.selectedNodeId) {
return {
'k-selected': true
}
}
else if (context.dataItem.id === this.previousSelectedNodeId) {
return {
'k-selected': false
}
}
});
}

onAction(e) {
this.zone.run(() => {
const row = this.treeList.view.data.find(dataItem => dataItem.data.id === e.dataItem.id);
if (row) {
this.previousSelectedNodeId = this.selectedNodeId;
this.selectedNodeId = row.data.id;
}
});

}

 

<kendo-treelist #treeList kendoTreeListExpandable kendoTreeListSelectable
[data]="(loadNodes$ | async)"
[fetchChildren]="fetchChildren"
[hasChildren]="hasChildren"
(selectionChange)="onSelectionChange($event)"
[rowClass]="rowCallback"
(expand)="onAction($event)"
(collapse)="onAction($event)">
Kyrylo
Top achievements
Rank 1
 asked on 05 Jan 2024
1 answer
27 views
Hi, there, so atm I'm trying to implement a custom filter menu, with kendo multiselect component, but I'm having some issues. So, what's happening it's that the filtering it's not working properly and I think the issue comes beacuse it's not getting the right currentFilter state. When I open the filter button it seems to do the filtering ok, but when I reopen the button, the filters selected previosly don't appear in the ui, despite the filtering persisting and I'm not able to unselect any filter at all, and if i try to filter again selecting new values it will just add the values to the currentFilter and perfoms the filtering adding the new values, plus the ones before. 


custom-component.ts

export class CustomMultiSelectFilterComponent implements AfterViewInit {

  @Output() public handleFilterChange = new EventEmitter<CompositeFilterDescriptor>()

  @Input() public data: string[] = []
  @Input() public textField: string = ""
  @Input() public valueField: string = ""
  @Input() public filter: CompositeFilterDescriptor = { logic: "or", filters: [] }
  @Input() public preFilterValue: string | null = null
  @Input() public filterService: FilterService
  @Input() public currentFilter: CompositeFilterDescriptor = { logic: "or", filters: [] }

  public constructor(
    filterService: FilterService
  ) {
    this.filterService = filterService
  }

  public filterChange(filter: CompositeFilterDescriptor): void {
    this.filter = filter
    this.data = filterBy(this.data , filter)
    this.handleFilterChange.emit(filter)
  }

  public onChange(values: string[], filterService: FilterService): void {
    filterService.filter({
      filters: values.map((value) => ({
        field: this.valueField,
        operator: "contains",
        value,
      })),
      logic: "or",
    })
  }

  public ngAfterViewInit(): void {
    if (this.filterService) {
      this.filterService.changes.subscribe((filter: CompositeFilterDescriptor) => {
        this.currentFilter = filter
        console.log("Current Filters:", this.currentFilter)
      })
    }
  }

}


custom-filter.html

<kendo-multiselect
  [data]="data"  
  [valuePrimitive]="true"
  [textField]="textField"
  [valueField]="valueField"
  [value]="filter | filterValues"
  (valueChange)="onChange($event, filterService)"
  >
</kendo-multiselect>

table.html


<kendo-grid
  kendoGridSelectBy="id"
  [kendoGridBinding]="users"
  filterable="menu"
  [sortable]="true"
  [resizable]="true"
  (selectionChange)="selectionChange($event)"
  [selectable]="selectableSettings"
  [selectedKeys]="[selectedKeyArray]"
  (filterChange)="handleFilterChange($event)"
  [filter]="filter"
>
  <kendo-grid-column-group title="{{ 'literal:Users | Total:' | translate }} {{ users.length }}" [columnMenu]="true">
    <kendo-grid-column field="roles" title="{{ 'literal:Roles' | translate }}" [width]="220" [headerStyle]="{ 'font-weight': 'bold' }">
      <ng-template kendoGridFilterMenuTemplate let-filter="filter" let-filterService="filterService">
        <app-custom-multiselect-filter
          [data]="rolesToFilter"
          textField="rolesToFilter"
          valueField="filterRoles"
          [preFilterValue]="preFilter"
          [filterService]="filterService"
          [currentFilter]="filter"
          >
        </app-custom


Yanmario
Telerik team
 answered on 02 Jan 2024
1 answer
28 views

Hello All,

I've got a product owner that requires the in-cell editing without needing to press Enter button.  They want the cell to automatically enter edit mode simply by arrowing around the grid.  My dev team is struggling to make this happen.  Any suggestions or samples that would help us accomplish this?  If we aren't able to make this work, we will have to use an entirely different framework (or roll our own) for grids, which I'm hoping to avoid.

Thanks

Martin Bechev
Telerik team
 answered on 13 Dec 2023
0 answers
21 views
I'm currently utilizing the kendoPagerTemplate within a grid. In the template I am using the built-in elements of:
PagerNextButtonsComponent
PagerNumericButtonsComponent
PagerPageSizesComponent 
PagerPrevButtonsComponent

I noticed that they generate kendo buttons and dropdown lists with classes that are from appearance options applied to them. Is there a way to choose which options they are, or am I forced to use CSS to select those class names and modify them to look like a different appearance option?
Aaron
Top achievements
Rank 1
 asked on 08 Dec 2023
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?