projects/i-components/src/lib/components/data-grid-template-column/data-grid-template-column.component.ts
OnInit
AfterContentInit
OnDestroy
providers |
{
provide: BaseDataGridColumnsComponent, useExisting: forwardRef(() => DataGridTemplateColumnComponent),
}
|
selector | wm-data-grid-template-column |
styleUrls | ./data-grid-template-column.component.scss |
Properties |
|
Methods |
|
Inputs |
constructor(injector: Injector, injectedModel: DataGridTemplateColumnModel)
|
|||||||||
Creates an instance of DataGridTemplateColumnComponent.
Parameters :
|
model | |
Type : DataGridTemplateColumnModel
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:77
|
|
Object with properties and events for the DataGridTemplateColumnComponent. |
canUserReorder | |
Type : boolean
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:95
|
canUserResize | |
Type : boolean
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:74
|
canUserSort | |
Type : boolean
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:117
|
header | |
Type : any
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:138
|
isReadOnly | |
Type : boolean
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:159
|
|
sets the readonly property of the datagrid cells |
maxWidth | |
Type : any
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:216
|
minWidth | |
Type : any
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:237
|
sortMemberPath | |
Type : string
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:181
|
visibility | |
Type : boolean
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:258
|
|
sets the visibility property of the column |
width | |
Type : DataGridLengthModel | string
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:202
|
|
Gets/sets the width of the column. |
ngAfterContentInit |
ngAfterContentInit()
|
Angular lifecycle
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Angular lifecycle hook.
Returns :
void
|
ngOnInit |
ngOnInit()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:109
|
Angular lifecycle
Returns :
void
|
Protected applyPendingResourceAssignment | ||||||
applyPendingResourceAssignment(model: DependencyObject)
|
||||||
Inherited from
BaseWrapperComponent
|
||||||
Defined in
BaseWrapperComponent:85
|
||||||
Apply pending resource assignments
Parameters :
Returns :
void
|
Protected checkForStaticResourceReference | ||||||||||||
checkForStaticResourceReference(property: DependencyProperty, obj: any)
|
||||||||||||
Inherited from
BaseWrapperComponent
|
||||||||||||
Defined in
BaseWrapperComponent:62
|
||||||||||||
Verifies if the given value is a resource value
Parameters :
Returns :
boolean
{boolean} true if the value was assigned |
Protected resolveResource | ||||||
resolveResource(key: any)
|
||||||
Inherited from
BaseWrapperComponent
|
||||||
Defined in
BaseWrapperComponent:112
|
||||||
Resolve the resource in the current context
Parameters :
Returns :
any
|
cellEditingTemplate |
Type : QueryList<TemplateRef<any>>
|
Decorators :
@ContentChildren('cellEditingTemplate', {descendants: false})
|
Template for the edit mode of the cells |
cellTemplate |
Type : QueryList<TemplateRef<any>>
|
Decorators :
@ContentChildren('cellTemplate', {descendants: false})
|
Template for the non edit mode of the cells |
model |
Type : DataGridTemplateColumnModel
|
Decorators :
@Input()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:77
|
Object with properties and events for the DataGridTemplateColumnComponent. |
Protected modelProxy |
Type : DataGridTemplateColumnModel
|
Default value : ModelProxy.create<DataGridTemplateColumnModel>()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:86
|
ModelProxy is a copy of the model, used on the component initial building to prevent crashes with external bindings. |
Protected pendingResourceValues |
Type : Array<>
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:42
|
Pending resource assignments These assignments are performed when the model is available |
Protected pendingSetValuesColumns |
Type : Array<>
|
Default value : []
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:51
|
A collection of pending values to assign to the model |
import {
forwardRef,
AfterContentInit,
Component,
ContentChildren,
Injector,
Input,
OnInit,
Optional,
QueryList,
TemplateRef,
OnDestroy,
} from '@angular/core';
import {
DataGridTemplateColumnModel,
DataTemplate,
ModelProxy,
} from '@mobilize/wms-framework';
import { BaseDataGridColumnsComponent } from '../data-grid-columns/base-data-grid-columns/base-data-grid-columns.component';
@Component({
selector: 'wm-data-grid-template-column',
template: '',
styleUrls: ['./data-grid-template-column.component.scss'],
providers: [
{
provide: BaseDataGridColumnsComponent,
useExisting: forwardRef(() => DataGridTemplateColumnComponent),
},
],
})
export class DataGridTemplateColumnComponent
extends BaseDataGridColumnsComponent
implements OnInit, AfterContentInit, OnDestroy
{
/**
* Template for the edit mode of the cells
*
* @type {QueryList<any>}
* @memberof DataGridTemplateColumnComponent
*/
@ContentChildren('cellEditingTemplate', { descendants: false })
cellEditingTemplate: QueryList<TemplateRef<any>>;
/**
* Template for the non edit mode of the cells
*
* @type {QueryList<any>}
* @memberof DataGridTemplateColumnComponent
*/
@ContentChildren('cellTemplate', { descendants: false })
cellTemplate: QueryList<TemplateRef<any>>;
/**
* Object with properties and events for the DataGridTemplateColumnComponent.
*
* @type {DataGridTemplateColumnModel}
* @memberof DataGridTemplateColumnComponent
*/
@Input()
model: DataGridTemplateColumnModel;
/**
* ModelProxy is a copy of the model, used on the component initial building to prevent crashes with external bindings.
*
* @private
* @type {DataGridTemplateColumnModel}
* @memberof DataGridTemplateColumnComponent
*/
protected modelProxy: DataGridTemplateColumnModel =
ModelProxy.create<DataGridTemplateColumnModel>();
/**
* Creates an instance of DataGridTemplateColumnComponent.
*
* @param {Injector} injector
* @param {DataGridTemplateColumnModel} [injectedModel=null]
* @memberof DataGridTemplateColumnComponent
*/
constructor(
private injector: Injector,
@Optional() protected injectedModel: DataGridTemplateColumnModel = null
) {
super();
this.model = injectedModel;
}
/**
* Angular lifecycle
*
* @memberof DataGridTemplateColumnComponent
*/
ngOnInit() {
this.model =
this.model || this.injectedModel || new DataGridTemplateColumnModel();
ModelProxy.copy(this.modelProxy, this.model);
this.modelProxy = this.model;
}
/**
* Angular lifecycle
*
* @memberof DataGridTemplateColumnComponent
*/
ngAfterContentInit() {
const cellEdTemp = this.cellEditingTemplate.toArray()[0];
if (cellEdTemp) {
this.model.CellEditingTemplate = new DataTemplate(cellEdTemp);
}
const cellTemp = this.cellTemplate.toArray()[0];
if (cellTemp) {
this.model.CellTemplate = new DataTemplate(cellTemp);
}
if (!this.model.Visibility) {
this.model.MaxWidth = 0;
}
}
/**
* Angular lifecycle hook.
*
* @memberof DataGridTemplateColumnComponent
*/
ngOnDestroy(): void {}
}
./data-grid-template-column.component.scss