projects/k-components/src/lib/components/datagridcolumn/datagridcolumn.component.ts
selector | wm-data-grid-column |
styleUrls | ./datagridcolumn.component.css |
templateUrl | ./datagridcolumn.component.html |
Properties |
|
Methods |
Inputs |
Field | |
Type : string
|
|
Default value : ''
|
|
Header | |
Type : string
|
|
Default value : ''
|
|
model | |
Type : DataGridColumnModel
|
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
columnContentTemplate |
Type : TemplateRef<any>
|
Decorators :
@ContentChild('columnContentTemplate', {static: true})
|
Field |
Type : string
|
Default value : ''
|
Decorators :
@Input()
|
Header |
Type : string
|
Default value : ''
|
Decorators :
@Input()
|
Public model |
Type : DataGridColumnModel
|
Decorators :
@Input()
|
import {
Component,
Input,
ContentChild,
TemplateRef,
OnInit,
} from '@angular/core';
import { DataGridColumnModel } from '@mobilize/wms-framework';
@Component({
selector: 'wm-data-grid-column',
templateUrl: './datagridcolumn.component.html',
styleUrls: ['./datagridcolumn.component.css'],
})
export class DataGridColumnComponent implements OnInit {
@Input()
public model: DataGridColumnModel;
@Input()
Header = '';
@Input()
Field = '';
@ContentChild('columnContentTemplate', { static: true })
columnContentTemplate: TemplateRef<any>;
ngOnInit(): void {
this.model = this.model ?? new DataGridColumnModel();
this.model.Header = this.Header !== '' ? this.Header : this.model.Header;
this.model.Field = this.Field !== '' ? this.Field : this.model.Field;
this.model.templateRef = this.columnContentTemplate;
}
}
<div></div>
./datagridcolumn.component.css