File

projects/i-components/src/lib/components/data-grid-columns/base-data-grid-columns/base-data-grid-columns.component.ts

Description

Base dataGridColumns

Extends

BaseWrapperComponent

Implements

OnInit

Index

Properties
Methods
Inputs
Accessors

Inputs

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.

Methods

ngOnInit
ngOnInit()

Angular lifecycle.

Returns : void
Protected applyPendingResourceAssignment
applyPendingResourceAssignment(model: DependencyObject)
Inherited from BaseWrapperComponent

Apply pending resource assignments

Parameters :
Name Type Optional
model DependencyObject No
Returns : void
Protected checkForStaticResourceReference
checkForStaticResourceReference(property: DependencyProperty, obj: any)
Inherited from BaseWrapperComponent

Verifies if the given value is a resource value

Parameters :
Name Type Optional Description
property DependencyProperty No

property to assign

obj any No

static resource reference candidate

Returns : boolean

{boolean} true if the value was assigned

Protected resolveResource
resolveResource(key: any)
Inherited from BaseWrapperComponent

Resolve the resource in the current context

Parameters :
Name Type Optional
key any No
Returns : any

Properties

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

Pending resource assignments

These assignments are performed when the model is available

Protected pendingSetValuesColumns
Type : Array<>
Default value : []
Inherited from BaseWrapperComponent

A collection of pending values to assign to the model

Accessors

canUserResize
getcanUserResize()

Gets CanUserResize property of the datagrid

Returns : boolean
setcanUserResize(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
canUserReorder
getcanUserReorder()

Gets CanUserReorder property for the column in the datagrid

Returns : boolean
setcanUserReorder(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
canUserSort
getcanUserSort()

Gets CanUserSort property for the column in the datagrid

Returns : boolean
setcanUserSort(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
header
getheader()

gets the header for the column in the datagrid

Returns : any
setheader(value: any)
Parameters :
Name Type Optional
value any No
Returns : void
isReadOnly
getisReadOnly()
Returns : boolean
setisReadOnly(value: boolean)

sets the readonly property of the datagrid cells

Parameters :
Name Type Optional
value boolean No
Returns : void
sortMemberPath
getsortMemberPath()

Gets SortMemberPath property for the column in the datagrid

Returns : string
setsortMemberPath(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
width
getwidth()

Gets/sets the width of the column.

Returns : DataGridLengthModel | string
setwidth(value: DataGridLengthModel | string)
Parameters :
Name Type Optional
value DataGridLengthModel | string No
Returns : void
maxWidth
getmaxWidth()

Get maxWidth property

Returns : any
setmaxWidth(value: any)
Parameters :
Name Type Optional
value any No
Returns : void
minWidth
getminWidth()

Get minWidth property

Returns : any
setminWidth(value: any)
Parameters :
Name Type Optional
value any No
Returns : void
visibility
getvisibility()

gets the visibility property of the column

Returns : boolean
setvisibility(value: boolean)

sets the visibility property of the column

Parameters :
Name Type Optional
value boolean No
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;
  }
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""