- Copyright:
- ParaSQL LLC 2013-2021. All rights reserved.
- License:
Fires:
- parasql.Event#event:click fired in response to a row click; this event is fired after changing the row index as a result of the click.
- parasql.Event#event:dblclick fired in response to a row double click.
- parasql.Event#rendercell fired each time a data cell is rendered; this allows you to apply additional conditional formatting as needed. See parasql.widget.ReportWidget#getLastRenderedDataCell for details.event:
Extends
Methods
addEventListener(type, listener)
Adds an event listener to this widget. This can also be done via the Events... option on the tool bar.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | A valid event type. |
listener |
string | A string containing either the name of a JavaScript function to call, an inline function to be called, or code that resolves to an object which implements a handleEvent(event) method. |
- Inherited From:
- See:
Examples
// add an inline function as an event listener
parasql.app.getWidgetById('ID1007').addEventListener('render','function (event) { event.target.getContentDiv().innerHTML = "Inline Hello World"; }');
// add a function call as an event listener
parasql.app.getWidgetById('ID1008').addEventListener('render','renderHelloWidget');
// add an object as an event listener; the object must implement handleEvent(event)
document.myClass = new MyClass();
parasql.app.getWidgetById('ID1009').addEventListener('render','document.myClass');
clearRecords()
Clears all rows in this.dataTable.
If the transaction set is dirty the user is prompted to save before clearing.
- Inherited From:
clearRecordsDiscardChanges()
Clears all rows in this.dataTable.
If the transaction set is dirty the changes are silently discarded.
- Since:
- v106
- Inherited From:
clearSelection()
Clears the current row selection.
getActiveQuery() → {parasql.widget.util.Query}
- Since:
- v114
- Inherited From:
Returns:
Returns the currently active query object, or null if there is no active query.
getDataTable() → {parasql.schema.DataTable}
- Inherited From:
Returns:
The DataTable containing the data for this object.
getLastRenderedDataCell() → {parasql.widget.ReportWidget.DataCellInfo}
- Since:
- v101
Returns:
Returns info about the last rendered data cell.
getQueries() → {Array.<parasql.widget.util.Query>}
You can change the active query via the parasql.widget.DataWidget#setActiveQuery method.
- Inherited From:
Returns:
Returns the array of Query objects owned by this DataWidget.
- Type
- Array.<parasql.widget.util.Query>
getQueryById(queryId) → (nullable) {parasql.widget.util.Query}
Parameters:
Name | Type | Description |
---|---|---|
queryId |
string |
- Since:
- v101
- Inherited From:
Returns:
Returns the Query object with the specified queryId, or null if no query with that ID exists.
getQueryByName(queryName) → (nullable) {parasql.widget.util.Query}
Parameters:
Name | Type | Description |
---|---|---|
queryName |
string |
- Since:
- v101
- Inherited From:
Returns:
Returns the Query object with the specified queryName, or null if no query with that name exists.
getSelectedRowIndex() → {number}
- Since:
- v60
- Inherited From:
Returns:
Returns the index of the currently selected row; if no row is selected returns -1. The first row is 0.
- Type
- number
getSelectedValue(tableName, columnName) → (nullable) {parasql.schema.DataValue}
Convenience method to return the DataValue in the specified column of the currently selected row.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
string | |
columnName |
string |
- Since:
- v71
Throws:
-
If tableName.columnName does not exist in the underlying DataTable.
- Type
- TypeError
Returns:
A DataValue object or null if no row is selected.
getTransactionSet() → {parasql.schema.TransactionSet}
- Since:
- v64
- Inherited From:
Returns:
getWidgetId() → (non-null) {string}
- Inherited From:
Returns:
Returns an immutable string that uniquely identifies this widget.
- Type
- string
isDisabled() → {boolean}
- Since:
- v110
- Inherited From:
Returns:
- Type
- boolean
redisplay()
Redisplays this widget.
- Inherited From:
refreshQuery()
Executes the currently active query.
To change the active query call the parasql.widget.DataWidget#setActiveQuery method.
- Inherited From:
setActiveQuery(queryObject)
Sets the active query but does not run it.
To run the active query call the parasql.widget.DataWidget#refreshQuery method.
Parameters:
Name | Type | Description |
---|---|---|
queryObject |
parasql.widget.util.Query | A valid query object. |
- Since:
- v88
- Inherited From:
setDisabled(flag)
WARNING: Subclasses overriding this method must not trigger a redisplay (causes an infinite loop).
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | If true, this widget will be rendered as disabled. |
- Since:
- v110
- Inherited From:
setSelectedRowIndex(index)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | The index of the row to select; the first row is 0. A value of -1 causes no row to be selected. |
- Since:
- v60
- Inherited From:
Type Definitions
DataCellInfo
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
tableName |
string | |
columnName |
string | |
dataCellDiv |
HTMLDivElement | The element to be styled. |
dataValue |
parasql.schema.DataValue | The data value object rendered into this data cell. |
- Since:
- v101