Serenity: Disable or remove row selection checkboxes

Created on 10 Dec 2019  路  2Comments  路  Source: serenity-is/Serenity

Has anyone figured how to disable or remove the row selection checkboxes per row based on the value of a column

ex. if column A value = yes then show checkbox else dont show checkbox.

Thanks

Most helpful comment

I see in the latest version 3.9.13 Volkan added new ability for GridRowSelectionMixin, it's selectable

protected createToolbarExtensions() {
    super.createToolbarExtensions();

    this.rowSelection = new Serenity.GridRowSelectionMixin(this, {
        // demo code
        selectable: (item: WellRow) => {
            if (item.Id % 2 == 0) {
                return true;
            }
            return false;
        }
    });
}

I think it will help you

All 2 comments

In abcGrid.ts:
```C#

    protected getItemCssClass(item: abcRow, index: number): string {
        let klass: string = "";
        if (item.ColumnA)
            klass += "hideCheckBox";
        return Q.trimToNull(klass);
    }
add css:
```C#
.hideCheckBox .select-item {
        display: none !important;
    }

I see in the latest version 3.9.13 Volkan added new ability for GridRowSelectionMixin, it's selectable

protected createToolbarExtensions() {
    super.createToolbarExtensions();

    this.rowSelection = new Serenity.GridRowSelectionMixin(this, {
        // demo code
        selectable: (item: WellRow) => {
            if (item.Id % 2 == 0) {
                return true;
            }
            return false;
        }
    });
}

I think it will help you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilroyFR picture kilroyFR  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

gfo2007 picture gfo2007  路  3Comments

Shraddha996 picture Shraddha996  路  3Comments

JohnRanger picture JohnRanger  路  3Comments