Constructors
Extends
Methods
-
getNumber(columnName, decimalSeparator, groupingSeparator){Number}
-
Returns the value of the given column as a
number.
If the optional parametersdecimalSeparatorandgroupingSeparatorare not set, this method will use localized values by default.Name Type Description columnNameString the name of the column
decimalSeparatorString optional the decimal separator
groupingSeparatorString optional the grouping separator
- Since:
- 5.0a
Returns:
Type Description Number the value of the given column Example
documentsContext.getGentableContext().getGridModel().getRow(1).getNumber("amount", ".", ","); -
index(){Number}
-
Returns the current index of the row.
- Since:
- 5.0a
Returns:
Type Description Number the current row index -
isVisible(){Boolean}
-
Returns if the row is visible or not.
- Since:
- 5.0a
Returns:
Type Description Boolean trueif the row is visible,falseotherwise -
reload(){Promise}
-
Reloads the current row and returns a
Promisefor the reload process to be completed.
Notice that reloading a row implies an full AJAX request/response to/from the server behind the scenes which is always performed asynchronously.
As a result, any code following areload()statement will be executed immediately while not waiting the reload process to be completed.
Code can be synchronized with the returnedPromiseobject which lets you provide a callback function that is called when thePromiseis fulfilled.- Since:
- 5.0a
Returns:
Type Description Promise the Promise that is fulfilled when the reload process is complete Example
var gridModel = documentsContext.getGentableContext().getGridModel(); var row = gridModel.addRow(); row.reload().then( function() { console.log("reload process complete"); }); // caution: code following "row.reload()" is invoked immediately -
toJSON(){Object}
-
Returns a (shallow) copy of the entire row for JSON serialization.
For example this method can be used for persistence, serialization or augmentation before being sent to the server.Returns:
Type Description Object the row json clone Example
var gridModel = documentsContext.getGentableContext().getGridModel(); var row = gridModel.getRow(0); var rowJson = row.toJSON(); console.log( JSON.stringify(rowJson) ); // -> "{"departure":{"city":"Sydney","IATA":"SYD","overdue":true},"primes":[2,3,5,7,11,13,17,19,23],"pi":3.14159265359}"