How can I disable the checkbox that is part of the Clarity dataset?

I am using Datagrid Clarity, and I need to disable checkbox selection under some conditions. I can not find the API for this. Please help and thanks.

+5
source share
2 answers

Disabling selections for specific rows in a datagrid is not yet available in Clarity, but there is a Contributions welcome issue for it: https://github.com/vmware/clarity/issues/1018

+4
source

I had a similar requirement and eventually implemented the behavior using a custom directive. look at: https://plnkr.co/edit/5fQkvG?p=preview

 @Directive({ selector: '[clrDisable]' }) export class DisableDirective implements OnInit, OnChanges { @Input('clrDisable') disabled:boolean constructor(private elementRef:ElementRef) { } ngOnInit(){ } ngOnChanges() { let nativeRef = this.elementRef.nativeElement; if(this.disabled) { nativeRef.classList.add("clr_disabled"); } else { nativeRef.classList.remove("clr_disabled"); } } } .clr_disabled{ pointer-events:none; background-color:#ccc; opacity:0.5; } 
0
source

Source: https://habr.com/ru/post/1271813/


All Articles