Class: GentableGridModel

documents.sdk.gentable.grid GentableGridModel

Constructors

Extends

Methods

addRow(row, options){GentableGridRowModel}

Adds the given row.

Name Type Description
row Object optional

values of the row that should be added

options Object optional
Name Type Description
index Number optional

the index where the row should be added

  • Since:
    • 5.0a
Returns:
Type Description
GentableGridRowModel
Example
grid.addRow();
grid.addRow({itemtext : "Ledersessel schwarz", unitprice : 22.89 });
grid.addRow({itemtext : "Ledersessel schwarz", unitprice : 22.89 }, { index : 1 });

columnsSize(){Number}

Returns the number of all grid columns.

  • Since:
    • 5.0a
Returns:
Type Description
Number the number of all columns

copyRow(srcIndex, dstIndex)

Copies the row from the srcIndex to the dstIndex.

Name Type Description
srcIndex Number

The index of the row that should be copied.

dstIndex Number

The index where the row should be copied to.

  • Since:
    • 5.0a

createRowKey(){String}

Creates a key for the current row.

  • Since:
    • 5.0a
Returns:
Type Description
String a key for the current row

getActiveRow(){GentableGridRowModel}

Returns the currently active grid row model.

Returns:
Type Description
GentableGridRowModel the active row

getColumn(name){GentableGridColumnModel}

Returns the column with the given name.

Name Type Description
name String
  • Since:
    • 5.0a
Returns:
Type Description
GentableGridColumnModel the column with the given name

inherited getColumns()

Returns a Backbone.Collection of all grid column models.

Returns:
Backbone.Collection the collection of all grid column models

getRow(index){GentableGridRowModel}

Returns the row at the given index.

Name Type Description
index Number
  • Since:
    • 5.0a
Returns:
Type Description
GentableGridRowModel the row at the given index

inherited getRows()

Returns a Backbone.Collection of all grid row models.

Returns:
Backbone.Collection the collection of all grid row models

getSelectedRows(){GentableGridRowCollection}

Returns a backbone collection of all currently selected grid row models.

Returns:
Type Description
GentableGridRowCollection the collection of all currently selected rows

moveRow(srcIndex, dstIndex)

Moves a row from the srcIndex to the dstIndex.

Name Type Description
srcIndex Number

The index of the row that should be moved.

dstIndex Number

The index where the row should be moved to.

  • Since:
    • 5.0a

removeRow(index)

Removes the row at the given index.

Name Type Description
index Number
  • Since:
    • 5.0a

resetActiveRow()

Removes the active state of all grid rows. After calling this method, none of the grid rows is activated anymore.

resetSelectedRows()

Removes the selected state of all grid rows. After calling this method, none of the grid rows is selected anymore.

rowsSize(){Number}

Returns the number of all grid rows.

  • Since:
    • 5.0a
Returns:
Type Description
Number the number of all rows

setActiveRow(index)

Sets the active grid row by its row index.

Name Type Description
index Number

the row index to be activated

setSelectedRows(indexes)

Sets the selected grid rows by their row indexes.

Name Type Description
indexes Array.<Number>

all row indexes to be selected