Unplanned
Last Updated: 15 Nov 2021 07:24 by ADMIN
Johann
Created on: 15 Nov 2021 07:24
Category: Grid
Type: Feature Request
1
disableSelection callback for Grid checkboxes

Could we have a turnkey solution which allows to disable a row selection which takes care of disabling only the relevant selection checkboxes and handle properly the "Select all" checkbox state (in header).

With CheckboxColumnComponent field which allows providing dataItem field name or predicate function.

<kendo-grid-checkbox-column showSelectAll="true" disableSelection="isDisabled">
</kendo-grid-checkbox-column>

<kendo-grid-checkbox-column showSelectAll="true" [disableSelection]="isDisabledPredicateFunction">
</kendo-grid-checkbox-column>

OR

If you don't want to add more selection concerns into CheckboxColumnComponent this field could be specified in your SelectableSettings as well:

public selectableSettngs: SelectableSettings = {
    enabled: true,
    checkboxOnly: false,
    mode: 'multiple',
    cell: false,
    drag: false,
    rowEnabled: mySelectableRowPredicateFunction
}

rowEnabled field could something like this:

export declare type RowEnabledSelectionFn = (context: RowArgs) => boolean | boolean;

export interface SelectableSettings {
    //...
    /**
     * Determines if row selection is allowed.
     *
     * @default true
     */
    rowEnabled?: RowEnabledSelectionFn;
}

Thank you

0 comments