We need to overwrite kendo-grid-column-chooser component reset button logic. We need reset button to select all columns that were selected during the initial load of grid.instead of current reset logic. Is there a way to overwrite reset button logic?
I tried <kendo-grid-column-chooser (reset)="resetColumnMenu($event)"></kendo-grid-column-chooser> but it didn't work.
Hello Telerik,
We have implemented a custom reusable filter cell component similar to the example of the multi-select checkbox example from the docs. The difficulty using that example however, is that when the filter is updated, the other filters in the grid are removed due to the use of filterservice.filter. Because the CompositeFilterDescriptor can contain both filters and composite filters, why does the base filter cell component's base methods not allow a CompositeFilterDescriptor to be provided to the UpdateFilter method?
protected filterByField(field: string): FilterDescriptor;
protected filtersByField(field: string): FilterDescriptor[];
protected removeFilter(field: string): CompositeFilterDescriptor;
protected updateFilter(filter: FilterDescriptor): CompositeFilterDescriptor;
protected applyFilter(filter: CompositeFilterDescriptor): void;
Our method for implementing the multi-checkbox filter cell was to build a composite filter using 'Or' logic and each selected value added as a filter descriptor with operator 'eq' and the selected item value as the value of the filter, and use a similar strategy as the base filter cell component to add this composite filter to the filter service's composite filter.
private getSelectedFilters(values: Item[]): CompositeFilterDescriptor {
const selected: FilterDescriptor[] = values.map((value) => {
return {
field: this.field,
operator: 'eq',
value: value.value,
};
});
return {
filters: selected,
logic: 'or',
};
}
public onChange(values: Item[]): void {
this.selectedValues = values;
const root = this.filter || {
filters: [],
logic: 'and',
};
this.removeFilter(this.field);
if (values !== null && values.length !== 0) {
root.filters.push(this.getSelectedFilters(values));
}
this.filterService.filter(root);
}
If the base filter cell component allowed the CompositeFilterDescriptor type or the FilterDescriptor type in the updateFilters method, we could simplify the logic in our filter cell component to be similar to the patterns shown in the drop-down list filter component example, as shown below, but with a composite filter descriptor such as the one generated by the above getSelectedFilters function.
this.applyFilter(
value === null // if value of the default item
? this.removeFilter(this.valueField) // remove the filter
: this.updateFilter({
// otherwise add/modify the filter for the field with the value
field: this.valueField,
operator: 'eq',
value,
})
); // and update the root filter
I think this would be a beneficial addition to the Kendo Angular2 product, as it would enable many more reusable filter components to be created more easily and also simplify/ enhance some of the existing examples you provide. If you would like more information or the full multiselect-filter component, I would be happy to supply it.
Thank you!
Hi,
It seems there is an issue with the material theme and nested grids. When you have master-detail nested grids, the entire last nested grid gets applied with the same styling as the bottom rows of all the other nested grid.
The styling in my browser is showing up as
Which causes the rows in the last grid to not appear.
I have attached an image where I have changed the styling to 5px and red so you can see that it is being incorrectly styled. You can see that even the other rows in in the last grid are getting styled along with the last row style.
I am running the latest version of Kendo.
Cheers,
Clint
Is it possible to modify the default filter for a date on a grid so that it is a "between" filter? i.e. the second clause will show "Is before or equal to" instead of "Is after or equal to"?
https://stackblitz.com/edit/angular-ygnmj1
Preferred default:
instead of:
Hello,
You have this jQuery example: Binding to Kinvey Backend Services. Do you have a similar example for Angular? I cannot find one.
Thank you.
As described here:
https://github.com/telerik/kendo-angular/issues/2809#event-3148229980
We are asking to add a simple css class to every master row opened. We have just to change stile every time row has detail open.
Thanks
When using the Grid control inside an Angular component which is shown in a dialog (via MatDialog), the component is not properly destroyed after closing the dialog. The same problem doesn't occur when the component instead contains, say, a TreeView.
The problem occurs in Angular 8 and 9, in the Chrome browser. I've created an Angular 8 demo here: https://stackblitz.com/edit/angular-thr9j1 and an Angular 9 demo here: https://stackblitz.com/edit/angular-ksfrqy
Run the demo, press the "Open dialog" button a number of times, then take a heap snapshot in the Chrome dev console (be sure to first select the proper Javascript VM instance, containing "angular-thr9j1" or "angular-ksfrqy"). The component shown in the dialog is called "MemoryLeakDialogComponent", so use that as a filter. You'll see that for every time you opened the dialog there's now an instance of the component on the heap.
The MemoryLeakDialogComponent contains just an empty kendo-grid tag with no attributes. If you edit its dialog template to instead contain a kendo-treeview component, everything is properly destroyed and garbage collected, which leads me to suspect a memory leak in the Grid component.
Can you add "extra" field to FilterableSettings to allow the user to set extra globally for all columns in a grid?
https://www.telerik.com/kendo-angular-ui/components/grid/api/FilterableSettings/
Currently, if I want to set extra to false for a column, I need to do something like this:
<kendo-grid-column field="ProductName" title="Product Name">
<ng-template kendoGridFilterMenuTemplate let-filter let-column="column" let-filterService="filterService">
<kendo-grid-string-filter-menu [extra]="false" [column]="column" [filter]="filter" [filterService]="filterService">
</kendo-grid-string-filter-menu>
</ng-template>
</kendo-grid-column>
But it would be simpler if we can do filterable:{extra:false} just like Kendo UI for jQuery. https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/filterable.extra
Issue: unable to filter data by itself written filter handlers.
Current implementation:
/**
* A complex filter expression. For more information, refer to the [`filterBy`]({% slug api_kendo-data-query_filterby %}) method.
*/
export interface CompositeFilterDescriptor {
/**
* The logical operation to use when the `filter.filters` option is set.
*
* The supported values are:
* * `"and"`
* * `"or"`
*/
logic: 'or' | 'and';
/**
* The nested filter expressions—either [`FilterDescriptor`]({% slug api_kendo-data-query_filterdescriptor %}), or [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}). Supports the same options as `filter`. You can nest filters indefinitely.
*/
filters: Array<FilterDescriptor | CompositeFilterDescriptor>;
}
Where filter descriptor has next available fields:
export interface FilterDescriptor {
/**
* The data item field to which the filter operator is applied.
*/
field?: string | Function;
/**
* The filter operator (comparison).
*
* The supported operators are:
* * `"eq"` (equal to)
* * `"neq"` (not equal to)
* * `"isnull"` (is equal to null)
* * `"isnotnull"` (is not equal to null)
* * `"lt"` (less than)
* * `"lte"` (less than or equal to)
* * `"gt"` (greater than)
* * `"gte"` (greater than or equal to)
*
* The following operators are supported for string fields only:
* * `"startswith"`
* * `"endswith"`
* * `"contains"`
* * `"doesnotcontain"`
* * `"isempty"`
* * `"isnotempty"`
*/
operator: string | Function;
/**
* The value to which the field is compared. Has to be of the same type as the field.
*/
value?: any;
/**
* Determines if the string comparison is case-insensitive.
*/
ignoreCase?: boolean;
}
export interface FilterDescriptor {
/**
* The data item field to which the filter operator is applied.
*/
field?: string | Function;
/**
* The filter operator (comparison).
*
* The supported operators are:
* * `"eq"` (equal to)
* * `"neq"` (not equal to)
* * `"isnull"` (is equal to null)
* * `"isnotnull"` (is not equal to null)
* * `"lt"` (less than)
* * `"lte"` (less than or equal to)
* * `"gt"` (greater than)
* * `"gte"` (greater than or equal to)
*
* The following operators are supported for string fields only:
* * `"startswith"`
* * `"endswith"`
* * `"contains"`
* * `"doesnotcontain"`
* * `"isempty"`
* * `"isnotempty"`
*/
operator: string | Function;
/**
* The value to which the field is compared. Has to be of the same type as the field.
*/
value?: any;
/**
* Determines if the string comparison is case-insensitive.
*/
ignoreCase?: boolean;
/** --------------- ADDITIONAL DATA --------------- */
/**
* Manages filtering operations with data for single row
*/
handler?: (dataItem: T) : Observable<boolean> | boolean;
/**
* Filter name to display on grid
*/
name?: Observable<string> | string;
}
Can you add a method to go to a specific page in the Grid?
It is easy in Kendo UI for jQuery, https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/page
dataSource.page(2);
The equivalent way of doing it in Kendo UI for Angular is to bind skip to a Grid, and calculate the skip by ourselves, but it doesn't feel as natural as doing datasource.page(2)
Hi there
I am wondering if there is a way to customize the column labels / titles used in the column-chooser component.
I'm using the grid component with columns and column-groups (see example below) and would like to reflect the title of the group in the column-chooser's list as well.
Right now the chooser shows two checkboxes per group "Amount", "Weight" "Amount", "Weight" but does not reflect the group title...
Users might not be sure which "Amount" or which "Weight" is affected by which checkbox (in fact in my real world application there may be even more than 2 Productgroups in a row).
@Component({
selector: 'my-app',
template: `
<kendo-grid [data]="data">
<ng-template kendoGridToolbarTemplate>
<kendo-grid-column-chooser></kendo-grid-column-chooser>
</ng-template>
<kendo-grid-column field="Field1"></kendo-grid-column>
<kendo-grid-column field="Field2" [hidden]="true"></kendo-grid-column>
<kendo-grid-column-group title="Productgroup A">
<kendo-grid-column title="Amount" field="groupA.amount"> </kendo-grid-column>
<kendo-grid-column title="Weight" field="groupA.weight"> </kendo-grid-column>
</kendo-grid-column-group>
<kendo-grid-column-group title="Productgroup B">
<kendo-grid-column title="Amount" field="groupB.amount"> </kendo-grid-column>
<kendo-grid-column title="Weight" field="groupB.weight"> </kendo-grid-column>
</kendo-grid-column-group>
</kendo-grid>
`
})
export class AppComponent {
public data: any[] = [{ Field1: 'Foo', Field2: 'Bar', groupA: { amount: 11, weight: 111, annotation: "none"}, groupB: { amount: 22, weight: 222, annotation: "yes"}}];
}
Thanks for any help!
Jochen
Kendo Grids for Angular has the ability to remove operators by using `[showOperators]="false"`, however this keeps the button visible.
We would like the option to also hide/remove the clear button.
Hi Team
It would be very helpful if Grid allow to prevent focus on cell out-of-box, at the moment, we have to handle focusin event then set focus to other cell, however when using navigation keys or shortcut key, we need to handle differently depend on which cell should be focus next.
Reproduction
- Use a grid with data coming from a service (or another source)
- Click the delete button (built in with the grid
It removes the element from the grid as soon as I click the button but I want to remove it only after confirming the deletion.
Hi Team,
Requesting a feature to grid rows merge like the below example,
Col1 | Col2 | Col3 | Col4 | Col5 | Col6 |
Row1 | Row1 | Row1 | Row1 | Row1 | Merge1 |
Row2 | Row2 | Row2 | Row2 | Row2 | |
Row3 | Row3 | Row3 | Row3 | Row3 | Merge2 |
Row4 | Row4 | Row4 | Row4 | Row4 | |
Row5 | Row5 | Row5 | Row5 | Row5 | |
Row6 | Row6 | Row6 | Row6 | Row6 | Merge3 |
Row7 | Row7 | Row7 | Row7 | Row7 | |
Row8 | Row8 | Row8 | Row8 | Row8 | Merge4 |
Row9 | Row9 | Row9 | Row9 | Row9 |
Thanks!