Class Reference
IRIS for UNIX 2019.3
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%ZEN] >  [Component] >  [tablePane]
Private  Storage   

class %ZEN.Component.tablePane extends simpleTablePane

This component draws an HTML table based on the contents of a query.
The data for the table can come from a pre-built class query, an SQL statement, or the tablePane can create an SQL query automatically.
The properties of the tablePane, as well as the auxiliary classes, %ZEN.Auxiliary.column, %ZEN.Auxiliary.condition, and %ZEN.Auxiliary.parameter, let you control the behavior and appearance of the tablePane.
Many of the characteristics of the tablePane are inherited from its superclass, %ZEN.Component.simpleTablePane. Refer to it for more details.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
2 36 56


Summary

Properties
%condition %import %includeFiles %page
%resource OnCreateResultSet OnExecuteResultSet align
autoExecute aux bodyHeight caption
cellSpacing clearSnapshot columnName columns
composite conditions containerStyle countRows
currColumn currPage dataSource dragEnabled
dropEnabled enableToggleSelect enclosingClass enclosingStyle
error extraColumnWidth filtersDisabled fixedHeaders
groupByClause headerLayout height hidden
hint hintClass hintStyle id
index initialExecute invalidMessage label
labelClass labelDisabledClass labelStyle lastUpdate
maxRows msgNoResult multiSelect name
nowrap onafterdrag onbeforedrag ondblclick
ondrag ondrop onheaderClick onhide
onkeypress onmouseoverClass onmultiselect onrefresh
onselectrow onshow onunselectrow onupdate
orderByClause pageSize parameters parent
permitClientSQL queryClass queryName refreshRequired
rowCount rowSelect selectedIndex selectedRows
showFilters showLabel showQuery showRowNumbers
showRowSelector showValueInTooltip showZebra slice
sortOrder sql suppressExceptionOnClientSQL tableName
title tuple unlockSession useKeys
useSnapshot valign value valueColumn
visible whereClause width window

Methods
%AddColumn %AddParameter %AddToSaveSet %Attr
%BindExport %ClassIsLatestVersion %ClassName %ConstructClone
%CreateResultSet %CreateSnapshot %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %DrawCell %DrawComponentHTML %DrawFilter
%DrawHTML %DrawJSStrings %DrawTable %EnclosingDivId
%Eval %EvalC %Extends %ForceClientRender
%GetEventHandlers %GetParameter %GetXMLName %IsA
%IsModified %IsTypeNumeric %MakeId %New
%NormalizeObject %ObjectModified %OnAddToPageAfter %OnAddToPageBefore
%OnCreateResultSet %OnDrawEnclosingDiv %OnDrawObjectProperties %OnExecuteResultSet
%OnObjectSynch %OnZENDeserialize %OriginalNamespace %PackageName
%QuoteValue %QuoteValueL10N %RemoveFromSaveSet %ResetQuery
%Self %SerializeObject %SetModified %ValidateObject
FetchRowFromSnapshot XMLDTD XMLExport XMLExportToStream
XMLExportToString XMLNew XMLSchema XMLSchemaNamespace
XMLSchemaType addNavigator appendColumn applyFilters
disableColumnFilters dragFinishHandler dragHandler dragNotifyHandler
dragStartHandler dropHandler dropStartHandler executeQuery
exposeComponent filterChanged filterKeyPressed findElement
fireOnUpdateEvent firstPage focus getColumnFilters
getEnclosingDiv getFilterValue getHidden getHintElement
getInsideWidth getLabelElement getPageCount getProperty
getRenderedRowData getRowData getSettings getType
getValue gotoPage headerClick invokeSuper
isOfType isRowSelected lastPage makeId
nextPage onCreate onDelete onEndModalHandler
onPopupAction onSerialize onStartModalHandler onloadHandler
onmouseHandler onunloadHandler packRows packRowsIE
previousPage refreshContents removeNavigator render
renderContents renderSVG resetColumnFilters resizeHeaders
selectAllMultiRows selectMultiRow selectRow setColumnFilters
setDateFilter setFilterValue setHidden setOffsetWidth
setOverlayMode setProperty showColumnFilters showDateSelector
startProgressBar stopProgressBar tpKeyDownHandler tpKeyPressHandler


Parameters

• parameter DOMAIN = "%ZEN";
• parameter SYSMODULE = "table";
If set, this indicates that this system component should be placed in the given "module". A module is a grouping of components within the same class package that share common include (js or css) files. Note that certain root classes are implicitly placed within the "core" module.
Classes outside of the Zen library should not set this, they should use the MODULE instead.

Properties

• property autoExecute as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
If true (the default), automatically re-execute the query for this table when the user changes the value of a column filter.
If false, the query will only be re-executed when the executeQuery is called.
• property bodyHeight as %ZEN.Datatype.length;
If present, this specifies the height of the body section of the table.
• property caption as %ZEN.Datatype.caption;
Caption displayed for this table using the HTML caption element.
This is a localized value.
• property cellSpacing as %ZEN.Datatype.integer [ InitialExpression = 0 ];
Amount of spacing around cells in the table. The default is 0 (no extra space around table cells). For a slight but noticeable separation, a useful value is 2.
• property clearSnapshot as %ZEN.Datatype.boolean(XMLPROJECTION="none",ZENSETTING=0) [ InitialExpression = 0 ];
Client-side, run-time flag that is set when client wants to force re-execution of the table query when the table is in "snapshot" mode.
• property columns as list of %ZEN.Auxiliary.column(XMLPROJECTION="ELEMENT",XMLREF=1,XMLTYPECONSTRAINT="CHOICE");
List of column information objects.
Each object specifies additional details about a column in the table.
• property conditions as list of %ZEN.Auxiliary.condition(XMLPROJECTION="ELEMENT",XMLREF=1,XMLTYPECONSTRAINT="CHOICE");
A list of conditions. These are special expression objects that are evaluated to add data-dependent styles to the table.
• property currColumn as %ZEN.Datatype.string(ZENEXPRESSION=1);
This is the logical name of the most recently selected column header. Typically this is used for sorting.
• property currPage as %ZEN.Datatype.integer [ InitialExpression = 1 ];
For snapshot mode, this is the number (1-based) of the current "page" within the snapshot that is displayed.
• property dataSource as %ZEN.Datatype.string(VALUELIST=",query,columns") [ InitialExpression = "query" ];
Specifies where the data columns of the table come from.
"query" (the default)- columns are displayed for each column in the data source query.
"columns" - only columns explicitly defined in the columns list are displayed.
• property extraColumnWidth as %ZEN.Datatype.length [ InitialExpression = 30 ];
Width used for extra columns, such as row number, row selector, etc.
• property filtersDisabled as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, disable column filters (if any).
• property fixedHeaders as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, then the header of the table will stay in position when the body of the table is scrolled.
• property headerLayout as %ZEN.Datatype.string(VALUELIST=",filtersOnTop,headersOnTop") [ InitialExpression = "filtersOnTop" ];
This property controls how to display the table header when column filters are used.
  • "filtersOnTop" - (the default) Display column filters above column headers.
  • "headersOnTop" - Display column headers above filters.
• property invalidMessage as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Invalid Date","%ZEN") ];
Localized "invalid date" message displayed by control.
• property lastUpdate as %ZEN.Datatype.string(XMLPROJECTION="none");
Time, in ODBC timestamp format, that the query for this table was last executed. This is set on the server whenever the query is for the tablePane is executed.
• property msgNoResult as %ZEN.Datatype.caption [ InitialExpression = $$$Text("No Results","%ZEN") ];
• property nowrap as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
IE does not support CSS nowrap correctly so this flag provides a way to control whether table cells allow word wrapping or not.
• property onheaderClick as %ZEN.Datatype.eventHandler;
onheaderClick event handler: This event is fired when the user clicks on a column header. The name of the column will be in the currColumn property.
• property onkeypress as %ZEN.Datatype.eventHandler;
onkeypress event handler: If useKeys is true, then this event handler code is run when the user presses a key within the tablePane.
• property pageSize as %ZEN.Datatype.integer [ InitialExpression = 0 ];
This is the number of items to display on a single "page" of the table. 0, the default, means show all data on first page. This can only be set to a non-zero value when the table is in snapshot mode.
• property parameters as list of %ZEN.Auxiliary.parameter(XMLNAME="parameter",XMLPROJECTION="ELEMENT",XMLREF=1);
User-defined list of parameters. These values are passed on to the user callback function that provides the query for this table.
• property permitClientSQL as %ZEN.Datatype.boolean(ZENENCRYPT=1,ZENEXPRESSION=1) [ InitialExpression = 0 ];
Flag for backwards compatibility. If permitClientSQL is set to true, query parameters may be set programatically through javascript on the client, depending on site and application settings this may constitute a security risk. If set to false (the default), the parameters may only be set on the server. This property is encrypted and any attempt to modify it on the client will result in an error.
• property refreshRequired as %ZEN.Datatype.boolean(XMLPROJECTION="none",ZENSETTING=0) [ InitialExpression = 0 ];
This property should be set to 1 by server-side methods that want to force the query associate with the tablePane to be re-executed.
• property rowCount as %ZEN.Datatype.string(XMLPROJECTION="none",ZENSETTING=0);
If present, this is the number of rows returned by the current query. This is calculated by the built-in query or the automatic query.
Note: this is a string as it could be set to "" or "100+".
• property showFilters as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
If true, display column filters (if any).
• property showQuery as %ZEN.Datatype.boolean(ZENENCRYPT=1,ZENEXPRESSION=1) [ InitialExpression = 0 ];
Server-side diagnostic flag. If true, display the query used to get data for this table.
This is an encrypted value and cannot be set on the client.
• property showValueInTooltip as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, then the tooltip (HTML title attribute) displayed for cells within the table will display the current value of the cell.
• property sortOrder as %ZEN.Datatype.string(VALUELIST=",asc,desc",ZENEXPRESSION=1);
For sortable tables, this is the order to sort values within the current column. Values can be "", "asc" (ascending), or "desc" (descending).
• property suppressExceptionOnClientSQL as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag for less intrusive remedial action when Client-side SQL modification is forbidden. If permitClientSQL is set to false (the default), this flag controls the rendering of the table if client side modification of the query parameters is detected. By default, a Zen Exception will be raised, warning of the security risk. If this flag is set to true, however, the exception will be suppressed and the table will re-render using the last known (server-side) values for the query parameters. In this case the client-side modifications are simply ignored. The default value is "false" indicating that the exception should be raised.
• property unlockSession as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag to control whether session is unlocked during updates to the table.
• property useKeys as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, then the tablePane will capture user keystrokes and use them for simple table navigation.
• property useSnapshot as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, create a temporary snapshot of the query results. This allows for paging and sorting without re-executing the query.
• property valueColumn as %ZEN.Datatype.string;
If defined, this is the name of the data column that provides a logical value for a selected row.

Methods

• method %AddColumn(pColumn As %ZEN.Auxiliary.column = "") as %ZEN.Auxiliary.column
Add a new column definition to this tablePane. If pColumn is not provided, this method will create a new column object.
• method %AddParameter(pParm As %ZEN.Auxiliary.parameter = "") as %ZEN.Auxiliary.parameter
Add a new parameter definition to this tablePane. If pParm is not provided, this method will create a new parameter object.
• method %CreateSnapshot(pTempID As %String, pRS As %ResultSet) as %Status
Create a temporary snapshot file from a result set. Assumes that result set has been created and executed. Users should not call this method.
• method %DrawCell(pMethod As %String, pName As %String, pSeed As %String) as %Status
Invoke user method to provide contents for a cell
• method %DrawFilter(pMethod As %String, pName As %String, pColInfo As %ZEN.Auxiliary.column) as %Status
Invoke user method to provide contents for a column filter.
• method %DrawHTML()
Draw innerHTML for this component (without enclosing div).
• method %DrawTable(pRS As %ResultSet) as %Status
Draw the table.
• classmethod %IsTypeNumeric(pType As %Integer) as %Boolean
Tests if a column type is a numeric type. Zen uses the CLIENTDATATYPE value, not ODBCTYPE. Client types are defined as: Returns the type of column n in the result set where type is an integer associated with the client datatype. If the type cannot be determined, 0 (zero) is returned.
1BINARY
2DATE
3DOUBLE
4HANDLE
5INTEGER
6LIST
7LONGVARCHAR
8TIME
9TIMESTAMP
10VARCHAR
11STATUS
12BINARYSTREAM
13CHARACTERSTREAM
14NUMERIC
15CURRENCY
16BOOLEAN
17OID
18BIGINT
19FDATE
20FTIMESTAMP
• method %OnAddToPageAfter() as %Status
If implemented, this callback method is called at page render-time after this component has been added to a page and after any of its children have been created but before the %DrawHTML methods are called.
• method %OnZENDeserialize() as %Status
This callback is invoked by the %ZENDeserialize method.
• method %ResetQuery() as %Status
This method is used (server-side only) to set the refreshRequired property when changing the underlying query from ObjectScript at run time. Client-side code should not "wrap" and call this function. Instead, JavaScript code should make use of the refreshTable() method.
• classmethod FetchRowFromSnapshot(pIndex As %Integer, pID As %String, pRow As %Integer, pCurrColumn As %String = "", pSortOrder As %String = "") as %Boolean [ ZenMethod ]
Internal method.
Fetch data from snapshot global and package up as a client object. pIndex is index of client component.
pID is internal ID of snapshot global.
pRow is row number to fetch.
• method addNavigator(nav) [ Language = javascript ]
Associate a navigator component with this tablePane. This is called by the navigator component.
• method appendColumn(colName) [ Language = javascript ]
Appends new column object to this table with the given column name. Returns the new column object.
Call the executeQuery method after calling this to update the table.
• method applyFilters() [ Language = javascript ]
If we are in autoExecute mode, then re-execute the query for this table using the current value of any column filters. If we are not in autoExecute mode, then do nothing.
• method disableColumnFilters(flag) [ Language = javascript ]
Disable (or enable) the column filters for this table.
• method executeQuery(remember, sync) [ Language = javascript ]
Force query for this table to be executed on the server. If the table is in snapshot mode, then a new snapshot will be created.
If remember is true, then the table will stay on the same page after the new results are displayed. If sync is defined and is true, the refresh will be executed synchronously (unless we are in deferred mode).
• method filterChanged(filterName, refresh, type, index) [ Language = javascript ]
User has changed the value of a filter. filterName is the name of the filter.
refresh indicates if the query should be re-executed.
type (optional) is type of filter.
index (optional) is control index for filters with multiple controls.
• method filterKeyPressed(evt, filterName, type, index) [ Language = javascript ]
User has pressed a key within a filter.
• method firstPage() [ Language = javascript ]
For multi-page display, go to the first page.
• method focus() [ Language = javascript ]
Client-side method to input focus to this control.
• method getColumnFilters() [ Language = javascript ]
Get column filters (if there are any). Returns an associative array containing the current values of the filter controls indexed by column name.
• method getFilterValue(cname) [ Language = javascript ]
Get current value of column filter associated with column cname.
• method getInsideWidth(element) [ Language = javascript ]
• method getPageCount() [ Language = javascript ]
For multi-page display, calculate the number of pages.
• method getRenderedRowData(row) [ Language = javascript ]
Explore the DOM and extract the data for the specified phyiscal table row (0-based) from the rendered table data (not to be confused with the logical row number of the data itself in a multi-page table).
This data is packaged into a JavaScript object whose properties correspond to the names of the columns in the table. If showRowNumbers is true the object will also contain a property called rowNum and will be contain the logical, enumerated row of the result set record
This is a client-side only call and can query only the values of the current page of the current table. The full, logical contents of the table (in snapshot mode) resides at the server and logical rows may be accessed using getRowData()
If there are not data columns to report or if the requested row is greater than the page size for the table, this function returns null.
• method getRowData(row) [ Language = javascript ]
For tables in snapshot mode only.
Go to the server and fetch the data for the specified row (0-based) from the table snapshot data. This data is packaged into a JavaScript object whose properties correspond to the names of the columns in the snapshot table.
For non-snapshot tables or out of range row numbers, returns null.
• method gotoPage(page) [ Language = javascript ]
For multi-page display, go to specified page (1 is first page), if possible.
• method headerClick(name) [ Language = javascript ]
User has clicked on a column header.
• method lastPage() [ Language = javascript ]
For multi-page display, go to the last page.
• method nextPage(giveFocus) [ Language = javascript ]
For multi-page display, go to next page, if possible.
• method onPopupAction(popupName, action, value) [ Language = javascript ]
This client event, if present, is fired when a popup page has specified this component as its parent and fires an action.
popupName is the name of the popup window sending the action.
action is the name of the action.
value is the value associated with the action.
• method onloadHandler() [ Language = javascript ]
When the page is loaded, check for alignment issues between the table header and the table body.
• method packRows() [ Language = javascript ]
• method packRowsIE() [ Language = javascript ]
• method previousPage(giveFocus) [ Language = javascript ]
For multi-page display, go to previous page, if possible. If giveFocus is true, then give focus back to the hidden control.
• method removeNavigator() [ Language = javascript ]
Remove the navigator component with this tablePane. This is called by the navigator component.
• method resetColumnFilters() [ Language = javascript ]
Reset the values of the column filters (if there are any).
• method resizeHeaders() [ Language = javascript ]
Under IE with fixedHeaders set to true, the table headers and the body columns may become misaligned. This routine checks for alignment issues in the rendered table and, if needed, reformats the header to accound for the space taken up by a vertical scrollbar in the body of the table.
• method setColumnFilters(state) [ Language = javascript ]
Set the value of all column filters (if there are any). state is an associative array containing the current values of the filter controls indexed by column name (as returned by getColumnFilters.
• method setDateFilter(group) [ Language = javascript ]
Set value of date filter box. index is 0 or 1 to indicate which date box to set.
• method setFilterValue(cname, value) [ Language = javascript ]
Set the value of column filter associated with column cname.
• method setOffsetWidth(element, width) [ Language = javascript ]
• method setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.
• method showColumnFilters(flag) [ Language = javascript ]
Show or hide columns filters (if there are any). Users should use setProperty('showFilters',true) instead.
• method showDateSelector(cname, index, type, minDate, maxDate) [ Language = javascript ]
Display date selector for a date filter box.
• method tpKeyDownHandler(evt) [ Language = javascript ]
Process key down event within the table's invisible edit control.
• method tpKeyPressHandler(evt) [ Language = javascript ]
Process key press event within the table's invisible edit control.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.