5.20193.637
RowCollection Wijmo API Class

RowCollection Class

Represents a collection of Row objects in a FlexGrid control.

Heirarchy

Constructors

constructor

Properties

ariaLabel

ariaLabel: string

Gets or sets a string used as an ARIA label for all rows in this collection.

For example, the code below adds ARIA labels to the header and data rows:

grid.rows.ariaLabel = 'data row';
grid.columnHeaders.rows.ariaLabel = 'header row';

defaultSize

defaultSize: number

Gets or sets the default size of elements in the collection.

frozen

frozen: number

Gets or sets the number of frozen rows or columns in the collection.

Frozen rows and columns do not scroll, and instead remain at the top or left of the grid, next to the fixed cells. Unlike fixed cells, however, frozen cells may be selected and edited like regular cells.

grid

grid: FlexGrid

Gets the FlexGrid that owns this collection.

isUpdating

isUpdating: boolean

Gets a value that indicates whether notifications are currently suspended (see beginUpdate and endUpdate).

length

length: number

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

maxGroupLevel

maxGroupLevel: number

Gets the maximum group level in the grid.

returns

The maximum group level or -1 if the grid has no group rows.

maxSize

maxSize: number

Gets or sets the maximum size of elements in the collection.

minSize

minSize: number

Gets or sets the minimum size of elements in the collection.

visibleLength

visibleLength: number

Gets the number of visible elements in the collection (Row.isVisible).

Methods

beginUpdate

  • beginUpdate(): void

canMoveElement

  • canMoveElement(src: number, dst: number): boolean
  • Checks whether an element can be moved from one position to another.

    Parameters

    • src: number

      The index of the element to move.

    • dst: number

      The position to which to move the element, or specify -1 to append the element.

    Returns boolean

    Returns true if the move is valid, false otherwise.

clear

  • clear(): void

concat

  • concat(...items: ConcatArray<Row>[]): Row[]
  • concat(...items: (T | ConcatArray<T>)[]): Row[]
  • Combines two or more arrays.

    Parameters

    • Rest ...items: ConcatArray<Row>[]

      Additional items to add to the end of array1.

    Returns Row[]

  • Combines two or more arrays.

    Parameters

    • Rest ...items: (T | ConcatArray<T>)[]

      Additional items to add to the end of array1.

    Returns Row[]

copyWithin

  • copyWithin(target: number, start: number, end?: number): this
  • Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

    Parameters

    • target: number

      If target is negative, it is treated as length+target where length is the length of the array.

    • start: number

      If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.

    • Optional end: number

      If not specified, length of the this object is used as its default value.

    Returns this

deferUpdate

  • deferUpdate(fn: Function): void
  • Executes a function within a beginUpdate/endUpdate block.

    The collection will not be refreshed until the function finishes. This method ensures endUpdate is called even if the function throws an exception.

    Parameters

    • fn: Function

      Function to be executed without updates.

    Returns void

endUpdate

  • endUpdate(): void

entries

  • entries(): IterableIterator<[number, Row]>
  • Returns an iterable of key, value pairs for every entry in the array

    Returns IterableIterator<[number, Row]>

every

  • every(callbackfn: Object, thisArg?: any): boolean
  • Determines whether all the members of an array satisfy the specified test.

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns boolean

fill

  • fill(value: Row, start?: number, end?: number): this
  • Returns the this object after filling the section identified by start and end with value

    Parameters

    • value: Row

      value to fill array section with

    • Optional start: number

      index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.

    • Optional end: number

      index to stop filling the array at. If end is negative, it is treated as length+end.

    Returns this

filter

  • filter<S>(callbackfn: Object, thisArg?: any): S[]
  • filter(callbackfn: Object, thisArg?: any): Row[]
  • Returns the elements of an array that meet the condition specified in a callback function.

    Type parameters

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns S[]

  • Returns the elements of an array that meet the condition specified in a callback function.

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns Row[]

findIndex

  • findIndex(predicate: Object, thisArg?: any): number
  • Returns the index of the first element in the array where predicate is true, and -1 otherwise.

    Parameters

    • predicate: Object

      find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

    • Optional thisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    Returns number

forEach

  • forEach(callbackfn: Object, thisArg?: any): void
  • Performs the specified action for each element in an array.

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns void

getItemAt

  • getItemAt(position: number): number
  • Gets the index of the element at a given physical position.

    Parameters

    • position: number

      Position of the item in the collection, in pixels.

    Returns number

getNextCell

  • getNextCell(index: number, move: SelMove, pageSize: number): any
  • Finds the next visible cell for a selection change.

    Parameters

    • index: number

      Starting index for the search.

    • move: SelMove

      Type of move (size and direction).

    • pageSize: number

      Size of a page (in case the move is a page up/down).

    Returns any

getTotalSize

  • getTotalSize(): number

implementsInterface

  • implementsInterface(interfaceName: string): boolean
  • Returns true if the caller queries for a supported interface.

    Parameters

    • interfaceName: string

      Name of the interface to look for.

    Returns boolean

    True if the caller queries for a supported interface.

includes

  • includes(searchElement: Row, fromIndex?: number): boolean
  • Determines whether an array includes a certain element, returning true or false as appropriate.

    Parameters

    • searchElement: Row

      The element to search for.

    • Optional fromIndex: number

      The position in this array at which to begin searching for searchElement.

    Returns boolean

indexOf

  • indexOf(searchElement: Row, fromIndex?: number): number
  • Searches for an item in the array.

    Parameters

    • searchElement: Row

      Element to locate in the array.

    • Optional fromIndex: number

      The index where the search should start.

    Returns number

    The index of the item in the array, or -1 if the item was not found.

insert

  • insert(index: number, item: Row): void
  • Inserts an item at a specific position in the array.

    Parameters

    • index: number

      Position where the item will be added.

    • item: Row

      Item to add to the array.

    Returns void

isFrozen

  • isFrozen(index: number): boolean
  • Checks whether a column or row is frozen.

    Parameters

    • index: number

      The index of the column or row to check.

    Returns boolean

join

  • join(separator?: string): string
  • Adds all the elements of an array separated by the specified separator string.

    Parameters

    • Optional separator: string

      A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

    Returns string

keys

  • keys(): IterableIterator<number>
  • Returns an iterable of keys in the array

    Returns IterableIterator<number>

lastIndexOf

  • lastIndexOf(searchElement: Row, fromIndex?: number): number
  • Returns the index of the last occurrence of a specified value in an array.

    Parameters

    • searchElement: Row

      The value to locate in the array.

    • Optional fromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

    Returns number

map

  • map<U>(callbackfn: Object, thisArg?: any): U[]
  • Calls a defined callback function on each element of an array, and returns an array that contains the results.

    Type parameters

    • U

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns U[]

moveElement

  • moveElement(src: number, dst: number, keepFrozenCount?: boolean): void
  • Moves an element from one position to another.

    Parameters

    • src: number

      Index of the element to move.

    • dst: number

      Position where the element should be moved to (-1 to append).

    • Optional keepFrozenCount: boolean

      Whether to keep the frozen element count when the movement is into or out of the frozen area.

    Returns void

onCollectionChanged

push

  • push(item: Row): number

remove

  • remove(item: Row): boolean
  • Removes an item from the array.

    Parameters

    • item: Row

      Item to remove.

    Returns boolean

    True if the item was removed, false if it wasn't found in the array.

removeAt

  • removeAt(index: number): void
  • Removes an item at a specific position in the array.

    Parameters

    • index: number

      Position of the item to remove.

    Returns void

reverse

  • reverse(): Row[]
  • Reverses the elements in an Array.

    Returns Row[]

setAt

  • setAt(index: number, item: Row): void
  • Assigns an item at a specific position in the array.

    Parameters

    • index: number

      Position where the item will be assigned.

    • item: Row

      Item to assign to the array.

    Returns void

shift

  • shift(): Row | undefined
  • Removes the first element from an array and returns it.

    Returns Row | undefined

slice

  • slice(begin?: number, end?: number): Row[]
  • Creates a shallow copy of a portion of an array.

    Parameters

    • Optional begin: number

      Position where the copy starts.

    • Optional end: number

      Position where the copy ends.

    Returns Row[]

    A shallow copy of a portion of an array.

some

  • some(callbackfn: Object, thisArg?: any): boolean
  • Determines whether the specified callback function returns true for any element of an array.

    Parameters

    • callbackfn: Object

      A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

    Returns boolean

sort

  • sort(compareFn?: Function): this
  • Sorts the elements of the array in place.

    Parameters

    • Optional compareFn: Function

      Specifies a function that defines the sort order. If specified, the function should take two arguments and should return -1, +1, or 0 to indicate the first argument is smaller, greater than, or equal to the second argument. If omitted, the array is sorted in dictionary order according to the string conversion of each element.

    Returns this

    A copy of the sorted array.

splice

  • splice(index: number, count: number, item?: any): any[]
  • Removes or adds items to the array.

    Parameters

    • index: number

      Position where items are to be added or removed.

    • count: number

      Number of items to remove from the array.

    • Optional item: any

      Item to add to the array.

    Returns any[]

    An array containing the removed elements.

toLocaleString

  • toLocaleString(): string
  • Returns a string representation of an array. The elements are converted to string using their toLocalString methods.

    Returns string

toString

  • toString(): string
  • Returns a string representation of an array.

    Returns string

unshift

  • unshift(...items: Row[]): number
  • Inserts new elements at the start of an array.

    Parameters

    • Rest ...items: Row[]

      Elements to insert at the start of the Array.

    Returns number

values

  • values(): IterableIterator<Row>
  • Returns an iterable of values in the array

    Returns IterableIterator<Row>

Events

collectionChanged

Occurs when the collection changes.