projects/i-components/src/lib/components/data-grid-columns/base-data-grid-columns/base-data-grid-columns.component.ts
Base dataGridColumns
Properties |
|
Methods |
|
Inputs |
Accessors |
canUserReorder | |
Type : boolean
|
|
canUserResize | |
Type : boolean
|
|
canUserSort | |
Type : boolean
|
|
header | |
Type : any
|
|
isReadOnly | |
Type : boolean
|
|
sets the readonly property of the datagrid cells |
maxWidth | |
Type : any
|
|
minWidth | |
Type : any
|
|
model | |
Type : DataGridColumnModel
|
|
DataGridColumnModel. |
sortMemberPath | |
Type : string
|
|
visibility | |
Type : boolean
|
|
sets the visibility property of the column |
width | |
Type : DataGridLengthModel | string
|
|
Gets/sets the width of the column. |
ngOnInit |
ngOnInit()
|
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
|
Public model |
Type : DataGridColumnModel
|
Decorators :
@Input()
|
DataGridColumnModel. |
Protected modelProxy |
Default value : ModelProxy.create<DataGridColumnModel>()
|
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 |
canUserResize | ||||||
getcanUserResize()
|
||||||
Gets CanUserResize property of the datagrid
Returns :
boolean
|
||||||
setcanUserResize(value: boolean)
|
||||||
Parameters :
Returns :
void
|
canUserReorder | ||||||
getcanUserReorder()
|
||||||
Gets CanUserReorder property for the column in the datagrid
Returns :
boolean
|
||||||
setcanUserReorder(value: boolean)
|
||||||
Parameters :
Returns :
void
|
canUserSort | ||||||
getcanUserSort()
|
||||||
Gets CanUserSort property for the column in the datagrid
Returns :
boolean
|
||||||
setcanUserSort(value: boolean)
|
||||||
Parameters :
Returns :
void
|
header | ||||||
getheader()
|
||||||
gets the header for the column in the datagrid
Returns :
any
|
||||||
setheader(value: any)
|
||||||
Parameters :
Returns :
void
|
isReadOnly | ||||||
getisReadOnly()
|
||||||
Returns :
boolean
|
||||||
setisReadOnly(value: boolean)
|
||||||
sets the readonly property of the datagrid cells
Parameters :
Returns :
void
|
sortMemberPath | ||||||
getsortMemberPath()
|
||||||
Gets SortMemberPath property for the column in the datagrid
Returns :
string
|
||||||
setsortMemberPath(value: string)
|
||||||
Parameters :
Returns :
void
|
width | ||||||
getwidth()
|
||||||
Gets/sets the width of the column.
Returns :
DataGridLengthModel | string
|
||||||
setwidth(value: DataGridLengthModel | string)
|
||||||
Parameters :
Returns :
void
|
maxWidth | ||||||
getmaxWidth()
|
||||||
Get maxWidth property
Returns :
any
|
||||||
setmaxWidth(value: any)
|
||||||
Parameters :
Returns :
void
|
minWidth | ||||||
getminWidth()
|
||||||
Get minWidth property
Returns :
any
|
||||||
setminWidth(value: any)
|
||||||
Parameters :
Returns :
void
|
visibility | ||||||
getvisibility()
|
||||||
gets the visibility property of the column
Returns :
boolean
|
||||||
setvisibility(value: boolean)
|
||||||
sets the visibility property of the column
Parameters :
Returns :
void
|
import { Component, Input, OnInit } from '@angular/core';
import {
DataGridColumnModel,
DataGridLengthModel,
ModelProxy,
} from '@mobilize/wms-framework';
import { BaseWrapperComponent } from '../../basewrapper/basewrapper.component';
/**
* Base dataGridColumns
*
* @export
* @class BaseDataGridColumnsComponent
* @extends {BaseWrapperComponent}
* @implements {OnInit}
*/
@Component({
template: '',
})
export class BaseDataGridColumnsComponent
extends BaseWrapperComponent
implements OnInit
{
/**
* DataGridColumnModel.
*
* @type {DataGridColumnModel}
* @memberof BaseDataGridColumnsComponent
*/
@Input()
public model: DataGridColumnModel;
/**
* ModelProxy is a copy of the model, used on the component initial building to prevent crashes with external bindings.
*
* @protected
* @memberof BaseDataGridColumnsComponent
*/
protected modelProxy = ModelProxy.create<DataGridColumnModel>();
/**
* Angular lifecycle.
*
* @memberof BaseDataGridColumnsComponent
*/
ngOnInit(): void {
this.model = this.model ?? new DataGridColumnModel();
ModelProxy.copy(this.modelProxy, this.model);
this.modelProxy = this.model;
this.applyPendingResourceAssignment(this.model);
}
/**
*
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set canUserResize(value: boolean) {
this.modelProxy.CanUserResize = value;
}
/**
* Gets CanUserResize property of the datagrid
*
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
get canUserResize(): boolean {
return this.model.CanUserResize;
}
/**
*
*
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set canUserReorder(value: boolean) {
this.modelProxy.CanUserReorder = value;
}
/**
* Gets CanUserReorder property for the column in the datagrid
*
* @readonly
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
get canUserReorder(): boolean {
return this.model.CanUserReorder;
}
/**
*
*
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set canUserSort(value: boolean) {
this.modelProxy.CanUserSort = value;
}
/**
* Gets CanUserSort property for the column in the datagrid
*
* @readonly
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
get canUserSort(): boolean {
return this.model.CanUserSort;
}
/**
*
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set header(value: any) {
this.modelProxy.Header = value;
}
/**
* gets the header for the column in the datagrid
*
* @readonly
* @type {*}
* @memberof BaseDataGridColumnsComponent
*/
get header(): any {
return this.model.Header;
}
/**
* sets the readonly property of the datagrid cells
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set isReadOnly(value: boolean) {
this.modelProxy.isReadOnly = value;
}
/**
*
*
* @readonly
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
get isReadOnly(): boolean {
return this.model.isReadOnly;
}
/**
*
*
* @type {string}
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set sortMemberPath(value: string) {
this.modelProxy.SortMemberPath = value;
}
/**
* Gets SortMemberPath property for the column in the datagrid
*
* @readonly
* @type {string}
* @memberof BaseDataGridColumnsComponent
*/
get sortMemberPath(): string {
return this.model.SortMemberPath;
}
/**
* Gets/sets the width of the column.
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
get width(): DataGridLengthModel | string {
return this.modelProxy.Width;
}
set width(value: DataGridLengthModel | string) {
this.modelProxy.Width = DataGridLengthModel.createDataGridLength(value);
}
/**
*
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set maxWidth(value: any) {
this.modelProxy.MaxWidth = value;
}
/**
* Get maxWidth property
*
* @readonly
* @type {*}
* @memberof BaseDataGridColumnsComponent
*/
get maxWidth(): any {
return this.model.MaxWidth;
}
/**
*
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set minWidth(value: any) {
this.modelProxy.MinWidth = Number(value);
}
/**
* Get minWidth property
*
* @readonly
* @type {*}
* @memberof BaseDataGridColumnsComponent
*/
get minWidth(): any {
return this.model.MinWidth;
}
/**
* sets the visibility property of the column
*
* @memberof BaseDataGridColumnsComponent
*/
@Input()
set visibility(value: boolean) {
if (
!this.checkForStaticResourceReference(
DataGridColumnModel.VisibilityProperty,
value
)
) {
this.modelProxy.Visibility = value;
}
}
/**
* gets the visibility property of the column
*
* @readonly
* @type {boolean}
* @memberof BaseDataGridColumnsComponent
*/
get visibility(): boolean {
return this.model.Visibility;
}
}