File

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

Description

RowBase class

Index

Properties
Accessors

Constructor

constructor(rowsManager: RowsManager)

Creates an instance of RowBase.

Parameters :
Name Type Optional
rowsManager RowsManager No

Properties

Protected _cells
Type : CellBaseCollectionModel

Internal cells collection

DefaultDataObject
Type : any
Default value : null

Gets / sets the object that will be used to compare against an object in the AddNewRow to detect if the AddNewRow is dirty.

Index
Default value : -1

Row index

IsActive
Type : boolean
Default value : false

Determinate if the Row is Active

onDemandData
Type : any

On demand function for row data resolving

RowsManager
Type : RowsManager

Reference to the RowsManager

Accessors

Columns
getColumns()

Collection of row columns

Data
getData()

Gets the row data object

Returns : any
setData(value: any)

Sets the row data object with onDemand lambda

Parameters :
Name Type Optional
value any No
Returns : void
ColumnLayout
getColumnLayout()

Get RowsManager ColumnLayout

Returns : ColumnLayout
Cells
getCells()

Gets cells property

setCells(value: CellBaseCollectionModel)

Sets cells property

Parameters :
Name Type Optional
value CellBaseCollectionModel No
Returns : void
import { CellBaseCollectionModel } from './CellBaseCollectionModel';
import { RowsManager } from './RowsManager';
import { ColumnLayout } from './ColumnLayout';
import { ColumnBaseCollection } from './XamGridModel';

/**
 * RowBase class
 *
 * @export
 * @class RowBase
 * @wType Infragistics.Controls.Grids.RowBase
 */
export class RowBase {
  /**
   * Internal cells collection
   *
   * @type {CellBaseCollectionModel}
   * @memberof RowBase
   */
  protected _cells: CellBaseCollectionModel;

  /**
   * Determinate if the Row is Active
   *
   * @type {boolean}
   * @memberof RowBase
   */
  IsActive: boolean = false;

  /**
   * On demand function for row data resolving
   *
   * @type {*}
   * @memberof XamGridRow
   */
  onDemandData: any;

  /**
   * Collection of row columns
   *
   * @readonly
   * @type {*}
   * @memberof RowBase
   */
  get Columns(): ColumnBaseCollection {
    return this.ColumnLayout.Columns;
  }

  /**
   * Reference to the RowsManager
   *
   * @type {RowsManager}
   * @memberof RowBase
   * @wProperty Manager
   */
  RowsManager: RowsManager;

  /**
   *  Gets the row data object
   *
   * @type {any}
   * @memberof RowBase
   */
  get Data(): any {
    return this.onDemandData?.() ?? null;
  }

  /**
   * Sets the row data object with onDemand lambda
   *
   * @memberof RowBase
   */
  set Data(value: any) {
    this.onDemandData = () => value;
  }

  /**
   *  Row index
   *
   * @memberof RowBase
   */
  Index = -1;

  /**
   * Get RowsManager ColumnLayout
   *
   * @type {ColumnLayout}
   * @memberof RowBase
   */
  get ColumnLayout(): ColumnLayout {
    return this.RowsManager.ColumnLayout;
  }

  /**
   * Creates an instance of RowBase.
   *
   * @param {RowsManager} rowsManager
   * @memberof RowBase
   */
  constructor(rowsManager: RowsManager) {
    this.RowsManager = rowsManager;
  }

  /**
   * Gets / sets the object that will be used to compare against
   * an object in the AddNewRow to detect if the AddNewRow is dirty.
   *
   * @type {*}
   * @memberof RowBase
   * @wIgnore
   */
  DefaultDataObject: any = null;

  /**
   * Gets cells property
   *
   * @type {CellBaseCollectionModel}
   * @memberof RowBase
   */
  get Cells(): CellBaseCollectionModel {
    if (this._cells == null) {
      this._cells = new CellBaseCollectionModel(this.Columns, this);
    }
    return this._cells;
  }

  /**
   * Sets cells property
   *
   * @type {CellBaseCollectionModel}
   * @memberof RowBase
   */
  set Cells(value: CellBaseCollectionModel) {
    this._cells = value;
  }
}

result-matching ""

    No results matching ""