File

projects/wms-framework/src/lib/models/controls/ColumnLayout.ts

Description

A class representing the column layout model.

Index

Properties
Methods
Accessors

Constructor

constructor(grid?: XamGridModel)

Creates a new instance of ColumnLayout

Parameters :
Name Type Optional
grid XamGridModel Yes

Properties

Columns
Type : ColumnBaseCollection
Default value : new ColumnBaseCollection(this)

Collection of columns

Grid
Type : XamGridModel

Reference to the XamGridModel.

Methods

OnColumnAdded
OnColumnAdded(columnBase: XamGridColumnBaseModel)

Callback function when added a new Column

Parameters :
Name Type Optional
columnBase XamGridColumnBaseModel No
Returns : void

Accessors

EditingSettings
getEditingSettings()

Get the grid editing settings object

Returns : EditingSettings
setEditingSettings(value: EditingSettings)

Set the grid editing settings object

Parameters :
Name Type Optional
value EditingSettings No
Returns : void
ColumnWidthResolved
getColumnWidthResolved()

Gets the column width associated to the layout

Returns : ColumnWidth
import { ColumnWidth } from './DataGridLengthModel';
import { XamGridColumnBaseModel } from './XamGridColumnModel';
import {
  ColumnBaseCollection,
  EditingSettings,
  XamGridModel,
} from './XamGridModel';

/**
 * A class representing the column layout model.
 *
 * @export
 * @class ColumnLayout
 * @wType Infragistics.Controls.Grids.ColumnLayout
 */
export class ColumnLayout {
  /**
   * Reference to the XamGridModel.
   *
   * @type {ColumnBaseCollection}
   * @memberof XamGridModel
   */
  Grid: XamGridModel;

  /**
   * Creates a new instance of ColumnLayout
   *
   * @param {XamGridModel} grid
   * @memberof ColumnLayout
   */
  constructor(grid?: XamGridModel) {
    this.Grid = grid ?? null;
  }

  /**
   * Collection of columns
   *
   * @type {ColumnBaseCollection}
   * @memberof ColumnLayout
   */
  Columns: ColumnBaseCollection = new ColumnBaseCollection(this);

  /**
   * Get the grid editing settings object
   *
   * @readonly
   * @type {EditingSettings}
   * @memberof ColumnLayout
   */
  get EditingSettings(): EditingSettings {
    return this.Grid.EditingSettings;
  }

  /**
   * Set the grid editing settings object
   *
   * @readonly
   * @type {EditingSettings}
   * @memberof ColumnLayout
   */
  set EditingSettings(value: EditingSettings) {
    this.Grid.EditingSettings = value;
  }

  /**
   * Gets the column width associated to the layout
   *
   * @readonly
   * @type {ColumnWidth}
   * @memberof ColumnLayout
   */
  get ColumnWidthResolved(): ColumnWidth {
    return this.Grid?.ColumnWidth ?? ColumnWidth.Auto;
  }

  /**
   * Callback function when added a new Column
   *
   * @type {XamGridColumnBaseModel}
   * @memberof ColumnLayout
   */
  OnColumnAdded(columnBase: XamGridColumnBaseModel): void {
    if (this.Grid != null) {
      columnBase.ColumnLayout = this;
    }
  }
}

result-matching ""

    No results matching ""