projects/i-components/src/lib/components/data-grid-text-column/data-grid-text-column.component.ts
This class represents the data grid text column component.
providers |
{
provide: BaseDataGridColumnsComponent, useExisting: forwardRef(() => DataGridTextColumnComponent),
}
|
selector | wm-data-grid-text-column |
styleUrls | ./data-grid-text-column.component.scss |
Properties |
|
Methods |
|
Inputs |
Accessors |
constructor(injector: Injector, injectedModel: DataGridTextColumnModel)
|
|||||||||
Creates an instance of DataGridTextColumnComponent.
Parameters :
|
binding | |
sets the field bind from the data |
model | |
Type : DataGridTextColumnModel
|
|
Inherited from
BaseDataGridColumnsComponent
|
|
Defined in
BaseDataGridColumnsComponent:92
|
|
Sets CanUserResize property of the datagrid |
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. |
ngOnInit |
ngOnInit()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:124
|
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
|
model |
Type : DataGridTextColumnModel
|
Decorators :
@Input()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:92
|
Object with properties and events for the DataGridTextColumnComponent. |
Protected modelProxy |
Type : DataGridTextColumnModel
|
Default value : ModelProxy.create<DataGridTextColumnModel>()
|
Inherited from
BaseDataGridColumnsComponent
|
Defined in
BaseDataGridColumnsComponent:101
|
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 |
binding | ||||||
getbinding()
|
||||||
gets the field bind from the data
Returns :
BindingInfo
|
||||||
setbinding(value: BindingInfo)
|
||||||
sets the field bind from the data
Parameters :
Returns :
void
|
import {
forwardRef,
Component,
Injector,
Input,
OnInit,
Optional,
} from '@angular/core';
import {
BindingInfo,
createBindingFromBindingInfo,
DataGridTextColumnModel,
ModelProxy,
} from '@mobilize/wms-framework';
import { BaseDataGridColumnsComponent } from '../data-grid-columns/base-data-grid-columns/base-data-grid-columns.component';
/**
* This class represents the data grid text column component.
*
* @export
* @class DataGridTextColumnComponent
* @extends {BaseDataGridColumnsComponent}
* @implements {OnInit}
*/
@Component({
selector: 'wm-data-grid-text-column',
template: '',
styleUrls: ['./data-grid-text-column.component.scss'],
providers: [
{
provide: BaseDataGridColumnsComponent,
useExisting: forwardRef(() => DataGridTextColumnComponent),
},
],
})
export class DataGridTextColumnComponent
extends BaseDataGridColumnsComponent
implements OnInit
{
/**
* sets the field bind from the data
*
* @memberof DataGridTextColumnComponent
*/
@Input()
set binding(value: BindingInfo) {
this.modelProxy.Binding = createBindingFromBindingInfo(value, null);
}
/**
* gets the field bind from the data
*
* @readonly
* @type {BindingInfo}
* @memberof DataGridTextColumnComponent
*/
get binding(): BindingInfo {
const currentValue = this.modelProxy.Binding;
return { bindingPath: currentValue?.Path?.path ?? '' };
}
/**
* Sets CanUserResize property of the datagrid
*
* @type {boolean}
* @memberof DataGridTextColumnComponent
*/
/**
* Object with properties and events for the DataGridTextColumnComponent.
*
* @type {DataGridTextColumnModel}
* @memberof DataGridTextColumnComponent
*/
@Input()
model: DataGridTextColumnModel;
/**
* ModelProxy is a copy of the model, used on the component initial building to prevent crashes with external bindings.
*
* @private
* @type {DataGridTextColumnModel}
* @memberof DataGridTextColumnComponent
*/
protected modelProxy: DataGridTextColumnModel =
ModelProxy.create<DataGridTextColumnModel>();
/**
* Creates an instance of DataGridTextColumnComponent.
*
* @param {Injector} injector
* @param {DataGridTextColumnModel} [injectedModel=null]
* @memberof DataGridTextColumnComponent
*/
constructor(
private injector: Injector,
@Optional() protected injectedModel: DataGridTextColumnModel = null
) {
super();
this.model = injectedModel;
}
/**
* Angular lifecycle
*
* @memberof DataGridTextColumnComponent
*/
ngOnInit() {
this.model =
this.model || this.injectedModel || new DataGridTextColumnModel();
ModelProxy.copy(this.modelProxy, this.model);
this.modelProxy = this.model;
}
}
./data-grid-text-column.component.scss