Table utilities.
- Source:
Methods
-
<static> cloneRequest(request, params)
create a deep clone of the given request.
-
create a deep clone of the given request. tbl_id is removed from the cloned request.
Parameters:
Name Type Description requestTableRequest the original request to clone
paramsObject additional parameters to add to the cloned request
- Source:
Returns:
- Type
- TableRequest
-
<static> doFetchTable(tableRequest [, hlRowIdx])
tableRequest will be sent to the server as a json string.
-
tableRequest will be sent to the server as a json string.
Parameters:
Name Type Argument Description tableRequestTableRequest is a table request params object
hlRowIdxnumber <optional>
set the highlightedRow. default to startIdx.
- Source:
Returns:
- Type
- Promise.<TableModel>
-
<static> doFetchTable(tableRequest [, hlRowIdx])
tableRequest will be sent to the server as a json string.
-
tableRequest will be sent to the server as a json string.
Parameters:
Name Type Argument Description tableRequestTableRequest is a table request params object
hlRowIdxnumber <optional>
set the highlightedRow. default to startIdx.
- Source:
Returns:
- Type
- Promise.<TableModel>
-
<static> findGroupByTblId(tbl_id)
returns the table group name given a tbl_id.
-
returns the table group name given a tbl_id. it will return undefined if the given tbl_id is not in a group.
Parameters:
Name Type Description tbl_idstring table id
- Source:
Returns:
- Type
- TableGroup
-
<static> getActiveTableId(tbl_group)
return the tbl_id of the active table for the given group.
-
return the tbl_id of the active table for the given group.
Parameters:
Name Type Description tbl_groupstring group name; defaults to 'main' if not given.
- Source:
Returns:
- Type
- string
-
<static> getAllColumns(tableModel)
returns all columns of the given table including hidden ones.
-
Parameters:
Name Type Description tableModelTableModel - Source:
Returns:
- Type
- Array.<TableColumn>
-
<static> getCellValue(tableModel, rowIdx, colName)
-
Parameters:
Name Type Description tableModelTableModel rowIdxnumber colNamestring - Source:
Returns:
- Type
- string
-
<static> getColumn(tableModel, ID)
returns column information for the given ID.
-
returns column information for the given ID.
Parameters:
Name Type Description tableModelTableModel IDstring - Source:
Returns:
- Type
- TableColumn
-
<static> getColumn(tableModel, colName)
returns column information for the given name.
-
returns column information for the given name.
Parameters:
Name Type Description tableModelTableModel colNamestring - Source:
Returns:
- Type
- TableColumn
-
<static> getColumnIdx(tableModel, colName)
Returns the column index with the given name; otherwise, -1.
-
Returns the column index with the given name; otherwise, -1.
Parameters:
Name Type Description tableModelTableModel colNamestring - Source:
Returns:
- Type
- number
-
<static> getColumns(tableModel, type)
returns the non-hidden columns of the given table. If type is given, it will only return columns that match type.
-
Parameters:
Name Type Description tableModelTableModel typeCOL_TYPE one of predefined COL_TYPE. defaults to 'ALL'.
- Source:
Returns:
- Type
- Array.<TableColumn>
-
<static> getColumnValues(tableModel, colName)
returns an array of all the values for a column
. -
returns an array of all the values for a column
Parameters:
Name Type Description tableModelTableModel colNamestring - Source:
Returns:
- Type
- Array.<Object>
-
<static> getRowValues(tableModel, rowIdx)
returns an array of all the values for a row
. -
returns an array of all the values for a row
Parameters:
Name Type Description tableModelTableModel rowIdxnumber - Source:
Returns:
- Type
- Array.<Object>
-
<static> getSelectedData(tbl_id, columnNames)
returns an array of all the values for a columns
. -
returns an array of all the values for a columns
Parameters:
Name Type Description tbl_idstring columnNamesArray.<string> defaults to all columns
- Source:
Returns:
- Type
- Promise.<TableModel>
-
<static> getTableGroup(tbl_group)
returns the table group information
. -
returns the table group information
Parameters:
Name Type Description tbl_groupstring the group name to look for
- Source:
Returns:
- Type
- TableGroup
-
<static> getTableSourceUrl(tbl_ui_id, params)
returns the url to download a snapshot of the current table data.
-
returns the url to download a snapshot of the current table data.
Parameters:
Name Type Description tbl_ui_idstring UI id of the table
paramsobject supplement parameter setting such as the information for workspace
- Source:
Returns:
- Type
- string
-
<static> getTableUiByTblId(tbl_id)
returns the first table working state for the given tbl_id
. -
returns the first table working state for the given tbl_id
Parameters:
Name Type Description tbl_idstring - Source:
Returns:
- Type
- Object
-
<static> getTblById(tbl_id)
returns the table model with the given tbl_id
. -
returns the table model with the given tbl_id
Parameters:
Name Type Description tbl_id- Source:
Returns:
- Type
- TableModel
-
<static> getTblIdsByGroup(tbl_group_id)
returns an array of tbl_id for the given tbl_group_id
. -
returns an array of tbl_id for the given tbl_group_id
Parameters:
Name Type Description tbl_group_idstring table group name. defaults to 'main' if not given
- Source:
Returns:
array of tbl_id
- Type
- Array.<String>
-
<static> getTblInfo(tableModel, aPageSize)
collects all available table information given the tableModel.
-
collects all available table information given the tableModel.
Parameters:
Name Type Description tableModelTableModel aPageSizenumber use this pageSize instead of the one in the request.
- Source:
Returns:
- Type
- Object
-
<static> getTblInfoById(tbl_id, aPageSize)
collects all available table information given the tbl_id
. -
collects all available table information given the tbl_id
Parameters:
Name Type Description tbl_idstring aPageSizenumber use this pageSize instead of the one in the request.
- Source:
Returns:
- Type
- Object
-
<static> getTblRowAsObj(tableModel [, rowIdx])
Return the row data as an object keyed by the column name
. -
Return the row data as an object keyed by the column name
Parameters:
Name Type Argument Description tableModelTableModel rowIdxNumber <optional>
= the index of the row to return, default to highlighted row
- Source:
Returns:
the values of the row keyed by the column name
- Type
- Object.<String, String>
-
<static> makeFileRequest( [title], source [, alt_source] [, options])
Creates a table request for tabular data from a file or url.
-
Creates a table request for tabular data from a file or url. Source of file may be from a url or an absolute path on the server.
Parameters:
Name Type Argument Description titlestring <optional>
title to display with this table.
sourcestring required; location of the ipac table. url or file path.
alt_sourcestring <optional>
use this if source does not exists.
optionsTableRequest <optional>
more options. see TableRequest for details.
- Source:
Returns:
- Type
- TableRequest
-
<static> makeIrsaCatalogRequest(title, project, catalog, params [, options])
creates the request to query IRSA catalogs.
-
creates the request to query IRSA catalogs.
Parameters:
Name Type Argument Description titlestring title to be displayed with this table result
projectstring catalogstring the catalog name to search
paramsConeParams | BoxParams | ElipParams one of 'Cone','Eliptical','Box','Polygon','Table','AllSky'.
optionsTableRequest <optional>
- Source:
Returns:
- Type
- TableRequest
-
<static> makeIrsaWorkspaceRequest(source [, title] [, options])
Creates a table request for tabular data from IRSA workspace.
-
Creates a table request for tabular data from IRSA workspace. Source should be an IRSA workspace path. i.e value returned from WorkspaceViewer
Parameters:
Name Type Argument Description sourcestring required; IRSA workspace path.
titlestring <optional>
title to display with this table.
optionsTableRequest <optional>
more options. see TableRequest for details.
- Source:
Returns:
- Type
- TableRequest
-
<static> makeTableFunctionRequest(searchRequest, id [, title] [, params] [, options])
create a request which will perform a function on the given searchRequest
. -
create a request which will perform a function on the given searchRequest
Parameters:
Name Type Argument Description searchRequestTableRequest required. the table's request this function should operate on
idstring required. SearchProcessor ID.
titlestring <optional>
title to display with this table.
paramsobject <optional>
the parameters to include with this request.
optionsTableRequest <optional>
more options. see TableRequest for details.
- Source:
Returns:
- Type
- TableRequest
-
<static> makeTblRequest(id [, title] [, params] [, options])
Creates a table request object for the given id.
-
Creates a table request object for the given id.
Parameters:
Name Type Argument Description idstring required. SearchProcessor ID.
titlestring <optional>
title to display with this table.
paramsobject <optional>
the parameters to include with this request.
optionsTableRequest <optional>
more options. see TableRequest for details.
- Source:
Returns:
- Type
- TableRequest
-
<static> onTableLoad(tbl_id)
return a promise of a tableModel for the given tbl_id.
-
return a promise of a tableModel for the given tbl_id.
Parameters:
Name Type Description tbl_idstring the table ID to watch for.
- Source:
Returns:
- Type
- Promise.<TableModel>
-
<static> smartMerge(target, source)
This function merges the source object into the target object by traversing and comparing every like path.
-
This function merges the source object into the target object by traversing and comparing every like path. If a value was merged at any data node in the data graph, the node and all of its parent nodes will be shallow cloned and returned. Otherwise, the target's value will be returned.
Parameters:
Name Type Description targetObject sourceObject - Source:
Returns:
- Type
- Object
-
<static> sortTableData(tableData, columns, sortInfoStr)
sort table data in-place.
-
sort table data in-place.
Parameters:
Name Type Description tableDataTableData columnsArray.<TableColumn> sortInfoStrstring - Source:
Returns:
- Type
- TableData
-
<static> uniqueTblId()
create a unique table id (tbl_id)
. -
create a unique table id (tbl_id)
- Source:
Returns:
- Type
- string
-
<static> uniqueTblUiId()
create a unique table UI id (tbl_ui_id)
. -
create a unique table UI id (tbl_ui_id)
- Source:
Returns:
- Type
- string