File

projects/i-components/src/lib/components/data-grid-text-column/data-grid-text-column.component.ts

Description

This class represents the data grid text column component.

Extends

BaseDataGridColumnsComponent

Implements

OnInit

Metadata

providers { provide: BaseDataGridColumnsComponent, useExisting: forwardRef(() => DataGridTextColumnComponent), }
selector wm-data-grid-text-column
styleUrls ./data-grid-text-column.component.scss

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(injector: Injector, injectedModel: DataGridTextColumnModel)

Creates an instance of DataGridTextColumnComponent.

Parameters :
Name Type Optional
injector Injector No
injectedModel DataGridTextColumnModel No

Inputs

binding

sets the field bind from the data

model
Type : DataGridTextColumnModel

Sets CanUserResize property of the datagrid

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
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

model
Type : DataGridTextColumnModel
Decorators :
@Input()

Object with properties and events for the DataGridTextColumnComponent.

Protected modelProxy
Type : DataGridTextColumnModel
Default value : ModelProxy.create<DataGridTextColumnModel>()

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

binding
getbinding()

gets the field bind from the data

Returns : BindingInfo
setbinding(value: BindingInfo)

sets the field bind from the data

Parameters :
Name Type Optional
value BindingInfo No
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

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""