# 隐藏列

列属性 `visible` 设置列的可见与隐藏，默认为 `true` 即处于可见状态，否则为隐藏

# 代码示例
```

    this.columns = [
        { field: 'id', width: 100, title: 'ID', visible: false},
        { 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} }
    ];

```

# 代码调用

`showColumn(fieldName: string)` 显示列
`hideColumn(fieldName: string)` 隐藏列

```
toggleColumn(field: string) {
    if (this.nameFieldVisible) {
        this.dg.hideColumn(field);
    } else {
        this.dg.showColumn(field);
    }
    this.nameFieldVisible = !this.nameFieldVisible;
}

```