projects/wms-framework/src/lib/models/controls/RowCollection.ts
        
Collection of rows of the XamGrid.
| Properties | 
| 
 | 
| Methods | 
| constructor(owner: IProvideDataItems<XamGridRow>, columnLayout: ColumnLayout) | |||||||||
| Creates a new instance of RowCollection. 
                                    Parameters :
                                     
 | 
| Private _columnLayout | 
| Type : ColumnLayout | 
| Internal reference of the ColumnLayout. | 
| Protected _owner | 
| Type : IProvideDataItems<T> | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:46 | 
| Owner of the data that the collection manipulates. | 
| CollectionChanged | 
| Type : SubscriptionEvent<void> | 
| Default value : new SubscriptionEvent() | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:235 | 
| Event that handles the change of the collection | 
| internalArray | 
| Type : T[] | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:228 | 
| Internal array used in case the used needs a array instead of the current class | 
| PropertyChanged | 
| Type : SubscriptionEvent<void> | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:63 | 
| Event that gets fired when a property changes. | 
| clear | 
| clear() | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:73 | 
| Clears the row collection. 
                        Returns :          void | 
| insert | |||||||||
| insert(index: number, value: XamGridRow) | |||||||||
| Inherited from          BindableItemCollection | |||||||||
| Defined in          BindableItemCollection:84 | |||||||||
| Insert an element in the data owner in a specific index. 
                        Parameters :
                         
 
                        Returns :          void | 
| remove | ||||||
| remove(value: XamGridRow) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:98 | ||||||
| Remove an element in the data owner. 
                        Parameters :
                         
 
                        Returns :          boolean{boolean} | 
| toArray | 
| toArray() | 
| Convert the collection to a simple array. 
                        Returns :      any[] | 
| add | ||||||
| add(item: any) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:246 | ||||||
| Add an item in the owner of the data 
                        Parameters :
                         
 
                        Returns :          void | 
| addItemSilently | |||||||||
| addItemSilently(index: number, value: T) | |||||||||
| Inherited from          BindableItemCollection | |||||||||
| Defined in          BindableItemCollection:76 | |||||||||
| To Implement 
                        Parameters :
                         
 
                        Returns :          void | 
| contains | ||||||
| contains(value: T) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:183 | ||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          boolean{boolean} | 
| copyTo | |||||||||
| copyTo(target: T[], index: number) | |||||||||
| Inherited from          BindableItemCollection | |||||||||
| Defined in          BindableItemCollection:208 | |||||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          void | 
| getItem | ||||||
| getItem(index: number) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:258 | ||||||
| Get an item from the owner of the data 
                        Parameters :
                         
 
                        Returns :          any{*} | 
| indexOf | ||||||
| indexOf(value: T) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:124 | ||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          number{number} | 
| removeAt | ||||||
| removeAt(index: number) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:148 | ||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          void | 
| removeItemSilently | ||||||
| removeItemSilently(index: number) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:88 | ||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          void | 
| resetItemsSilently | ||||||
| resetItemsSilently(index: number) | ||||||
| Inherited from          BindableItemCollection | ||||||
| Defined in          BindableItemCollection:100 | ||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          void | 
| setItem | |||||||||
| setItem(index: number, value: T) | |||||||||
| Inherited from          BindableItemCollection | |||||||||
| Defined in          BindableItemCollection:111 | |||||||||
| To implement 
                        Parameters :
                         
 
                        Returns :          void | 
| sort | 
| sort() | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:157 | 
| To implement 
                        Returns :          any | 
| () | 
| Inherited from          BindableItemCollection | 
| Defined in          BindableItemCollection:218 | 
| Iterator of the iterable class 
                        Returns :      Iterator<T, any, undefined>{Iterator<T, any, undefined>} | 
import { XamGridRow } from './XamGridRow';
import { BindableItemCollection } from './BindableItemCollection';
import { ColumnLayout } from './ColumnLayout';
import { IProvideDataItems } from './IProvideDataItems';
import { iuAny } from '../../baseframework/collections';
/**
 * Collection of rows of the XamGrid.
 *
 * @export
 * @class RowCollection
 * @extends {BindableItemCollection<XamGridRow>}
 * @wType Infragistics.Controls.Grids.RowCollection
 */
export class RowCollection extends BindableItemCollection<XamGridRow> {
  /**
   * Internal reference of the ColumnLayout.
   *
   * @private
   * @type {ColumnLayout}
   * @memberof RowCollection
   */
  private _columnLayout: ColumnLayout;
  /**
   * Creates a new instance of RowCollection.
   *
   * @param {IProvideDataItems<XamGridRow>} owner
   * @param {ColumnLayout} columnLayout
   * @memberof RowCollection
   */
  constructor(
    owner: IProvideDataItems<XamGridRow>,
    columnLayout: ColumnLayout
  ) {
    super(owner);
    this._columnLayout = columnLayout;
  }
  /**
   * Convert the collection to a simple array.
   *
   * @type {any[]}
   * @memberof RowCollection
   */
  toArray(): any[] {
    return this._owner.toArray();
  }
  /**
   * Clears the row collection.
   *
   * @type {void}
   * @memberof RowCollection
   */
  clear(): void {
    this._owner.Clear();
  }
  /**
   * Insert an element in the data owner in a specific index.
   *
   * @param {number} index
   * @param {XamGridRow} value
   * @memberof RowCollection
   */
  insert(index: number, value: XamGridRow): void {
    super.insert(index, value);
    if (value != null) {
      value.Index = index;
    }
  }
  /**
   * Remove an element in the data owner.
   *
   * @param {XamGridRow} value
   * @return {*}  {boolean}
   * @memberof RowCollection
   */
  remove(value: XamGridRow): boolean {
    const selectedRows =
      this._columnLayout.Grid.SelectionSettings?.SelectedRows;
    if (
      selectedRows &&
      iuAny(selectedRows, (row) => value == row || value.Data === row.Data)
    ) {
      selectedRows.remove(value);
    }
    return super.remove(value);
  }
}