# 禁止行选择及钩选

`disableRow`: 禁止选中行的自定义函数，返回`boolean`, `true` 禁止选择， `false` 可选中


### HTML 模板
``` html
<farris-datagrid [disabled]="disabled"
    [columns]="columns" [data]="items" [pageSize]="5" [showBorder]="showBorder"
    [showLineNumber]="showRowNumber" [fit]="false" [fitColumns]="false"
    [virtualized]="false"
    [striped]="striped" [pagination]="false"
    [showCheckbox]="true" [checkOnSelect]="true" [selectOnCheck]="true"
    [disableRow]="canNotSelectRow">
</farris-datagrid>
```

### Component

```javascript
import { Component, OnInit } from '@angular/core';

import { DATAGRID_REST_SERVICEE, CalculationType } from '@farris/ui-datagrid';
import { DemoDataService, RECORD_COUNT } from '../../demo-data.service';
import { DemoDataSeed } from '../../demo-data-seed';

@Component({
    selector: 'demo-disable-select',
    templateUrl: './demo-disable-select.component.html',
    providers: [
        { provide: RECORD_COUNT, useValue: 50 },
        { provide: DATAGRID_REST_SERVICEE, useClass: DemoDataService }
    ]
})
export class DemoDisableSelectComponent implements OnInit {
    columns = [];
    items;
    total = 0;
    pageSize = 100;

    showRowNumber = true;
    showBorder = true;
    borderType = 'both';
    striped = false;
    disabled = false;

    constructor() { }

    ngOnInit(): void {

        const enumData = DemoDataSeed.enumData();
        const enumOpts = { valueField: 'value', textField: 'label', data: enumData };

        this.columns = [
            { field: 'id', width: 100, title: 'ID', footer: {
                options: { text: '合计'},
                formatter: (v, d, i) => {
                    return `<b>${v}</b>`;
                }
            }},
            { field: 'name', width: 130, title: '姓名'},
            { field: 'sex', width: 70, title: '性别' },
            { field: 'birthday', width: 120, title: '出生日期'},
            { field: 'maray', width: 70, title: '婚否', formatter: { type: 'boolean', options: { trueText: '已婚', falseText: '未婚' }}},
            { field: 'addr', width: 170, title: '地址' },
            { field: 'company', width: 100, title: '公司'},
            { field: 'nianxin', width: 70, title: '年薪', footer: {
                options: { calculationType: CalculationType.sum},
                formatter: { type: 'number', options: { prefix: '￥', suffix: '元', precision: 2 }}
            }},
            { field: 'zhiwei', width: 100, title: '职位', formatter: {type: 'enum', options: enumOpts} }
        ];

    }

    canNotSelectRow = (row, index) => {
        return row['sex'] === '女';
    }
}
```