Class sap.m.TableModule: sap/m/Table

extends ListBase

sap.m.Table control provides a set of sophisticated and convenience functions for responsive table design. To render the sap.m.Table properly, the order of the columns aggregation should match with the order of the items cells aggregation. Also sap.m.Table requires at least one visible sap.m.Column in columns aggregation. For mobile devices, the recommended limit of table rows is 100 (based on 4 columns) to assure proper performance. To improve initial rendering on large tables, use the growing feature.


Since: 1.16.
Constructor Summary
new sap.m.Table(sId?, mSettings?)Constructor for a new Table.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.Table.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.Table with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.Table.getMetadata()Returns a metadata object for class sap.m.Table.
addColumn(oColumn)Adds some column to the aggregation columns.
destroyColumns()Destroys all the columns in the aggregation columns.
getBackgroundDesign()Gets current value of property backgroundDesign.
getColumns(bSort?)Getter for aggregation columns.
getFixedLayout()Gets current value of property fixedLayout.
getShowOverlay()Gets current value of property showOverlay.
indexOfColumn(oColumn)Checks for the provided sap.m.Column in the aggregation columns.
insertColumn(oColumn, iIndex)Inserts a column into the aggregation columns.
removeAllColumns()Removes all the controls from the aggregation columns.
removeColumn(vColumn)Removes a column from the aggregation columns.
setBackgroundDesign(sBackgroundDesign)Sets a new value for property backgroundDesign.
setFixedLayout(bFixedLayout)Sets a new value for property fixedLayout.
setShowOverlay(bShowOverlay)Sets a new value for property showOverlay.
Methods borrowed from class sap.m.ListBase
addAriaLabelledBy, addItem, attachDelete, attachGrowingFinished, attachGrowingStarted, attachItemPress, attachSelect, attachSelectionChange, attachSwipe, attachUpdateFinished, attachUpdateStarted, bindItems, destroyHeaderToolbar, destroyInfoToolbar, destroyItems, destroySwipeContent, detachDelete, detachGrowingFinished, detachGrowingStarted, detachItemPress, detachSelect, detachSelectionChange, detachSwipe, detachUpdateFinished, detachUpdateStarted, fireDelete, fireGrowingFinished, fireGrowingStarted, fireItemPress, fireSelect, fireSelectionChange, fireSwipe, fireUpdateFinished, fireUpdateStarted, getAriaLabelledBy, getEnableBusyIndicator, getFooterText, getGrowing, getGrowingInfo, getGrowingScrollToLoad, getGrowingThreshold, getGrowingTriggerText, getHeaderDesign, getHeaderText, getHeaderToolbar, getIncludeItemInSelection, getInfoToolbar, getInset, getItemNavigation, getItems, getKeyboardMode, getLastMode, getMode, getModeAnimationOn, getNoDataText, getRememberSelections, getSelectedContexts, getSelectedItem, getSelectedItems, getShowNoData, getShowSeparators, getShowUnread, getSwipeContent, getSwipeDirection, getSwipedItem, getWidth, indexOfItem, insertItem, removeAllAriaLabelledBy, removeAllItems, removeAriaLabelledBy, removeItem, removeSelections, selectAll, setEnableBusyIndicator, setFooterText, setGrowing, setGrowingScrollToLoad, setGrowingThreshold, setGrowingTriggerText, setHeaderDesign, setHeaderText, setHeaderToolbar, setIncludeItemInSelection, setInfoToolbar, setInset, setKeyboardMode, setMode, setModeAnimationOn, setNoDataText, setRememberSelections, setSelectedItem, setSelectedItemById, setShowNoData, setShowSeparators, setShowUnread, setSwipeContent, setSwipeDirection, setWidth, swipeOut, unbindItems
Constructor Detail
new sap.m.Table(sId?, mSettings?)
Constructor for a new Table.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.m.ListBase can be used as well.

Parameters:
{string}sId? Id for the new control, generated automatically if no id is given
{object}mSettings? Initial settings for the new control
Method Detail
sap.m.Table.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Table with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.ListBase.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.m.Table.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.Table.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addColumn(oColumn): sap.m.Table
Adds some column to the aggregation columns.
Parameters:
{sap.m.Column}oColumn the column to add; if empty, nothing is inserted
Returns:
{sap.m.Table} Reference to this in order to allow method chaining
destroyColumns(): sap.m.Table
Destroys all the columns in the aggregation columns.
Returns:
{sap.m.Table} Reference to this in order to allow method chaining
getBackgroundDesign(): sap.m.BackgroundDesign
Gets current value of property backgroundDesign.

Sets the background style of the table. Depending on the theme, you can change the state of the background from Solid to Translucent or to Transparent.

Default value is Translucent.

Returns:
{sap.m.BackgroundDesign} Value of property backgroundDesign
getColumns(bSort?): sap.m.Column[]
Getter for aggregation columns.
Parameters:
{Boolean}bSort? set true to get the columns in an order that respects personalization settings
Returns:
{sap.m.Column[]} columns of the Table
getFixedLayout(): boolean
Gets current value of property fixedLayout.

Defines the algorithm to be used to layout the table cells, rows, and columns. By default, a table is rendered with fixed layout algorithm. This means the horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells. Cells in subsequent rows do not affect column widths. This allows a browser to layout the table faster than the auto table layout since the browser can begin to display the table once the first row has been analyzed.

When this property is set to false, sap.m.Table is rendered with auto layout algorithm. This means, the width of the table and its cells depends on the contents of the cells. The column width is set by the widest unbreakable content inside the cells. This can make the rendering slow, since the browser needs to read through all the content in the table before determining the final layout. Note: Since sap.m.Table does not have its own scrollbars, setting fixedLayout to false can force the table to overflow, which may cause visual problems. It is suggested to use this property when a table has a few columns in wide screens or within the horizontal scroll container (e.g sap.m.Dialog) to handle overflow. In auto layout mode the width property of sap.m.Column is taken into account as a minimum width.

Default value is true.

Since:
1.22
Returns:
{boolean} Value of property fixedLayout
getShowOverlay(): boolean
Gets current value of property showOverlay.

Setting this property to true will show an overlay on top of the table content and prevents the user interaction with it.

Default value is false.

Since:
1.22.1
Returns:
{boolean} Value of property showOverlay
indexOfColumn(oColumn): int
Checks for the provided sap.m.Column in the aggregation columns. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Column}oColumn The column whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertColumn(oColumn, iIndex): sap.m.Table
Inserts a column into the aggregation columns.
Parameters:
{sap.m.Column}oColumn the column to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the column should be inserted at; for a negative value of iIndex, the column is inserted at position 0; for a value greater than the current size of the aggregation, the column is inserted at the last position
Returns:
{sap.m.Table} Reference to this in order to allow method chaining
removeAllColumns(): sap.m.Column[]
Removes all the controls from the aggregation columns.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.Column[]} An array of the removed elements (might be empty)
removeColumn(vColumn): sap.m.Column
Removes a column from the aggregation columns.
Parameters:
{int|string|sap.m.Column}vColumn The columnto remove or its index or id
Returns:
{sap.m.Column} The removed column or null
setBackgroundDesign(sBackgroundDesign): sap.m.Table
Sets a new value for property backgroundDesign.

Sets the background style of the table. Depending on the theme, you can change the state of the background from Solid to Translucent or to Transparent.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Translucent.

Parameters:
{sap.m.BackgroundDesign}sBackgroundDesign New value for property backgroundDesign
Returns:
{sap.m.Table} Reference to this in order to allow method chaining
setFixedLayout(bFixedLayout): sap.m.Table
Sets a new value for property fixedLayout.

Defines the algorithm to be used to layout the table cells, rows, and columns. By default, a table is rendered with fixed layout algorithm. This means the horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells. Cells in subsequent rows do not affect column widths. This allows a browser to layout the table faster than the auto table layout since the browser can begin to display the table once the first row has been analyzed.

When this property is set to false, sap.m.Table is rendered with auto layout algorithm. This means, the width of the table and its cells depends on the contents of the cells. The column width is set by the widest unbreakable content inside the cells. This can make the rendering slow, since the browser needs to read through all the content in the table before determining the final layout. Note: Since sap.m.Table does not have its own scrollbars, setting fixedLayout to false can force the table to overflow, which may cause visual problems. It is suggested to use this property when a table has a few columns in wide screens or within the horizontal scroll container (e.g sap.m.Dialog) to handle overflow. In auto layout mode the width property of sap.m.Column is taken into account as a minimum width.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bFixedLayout New value for property fixedLayout
Since:
1.22
Returns:
{sap.m.Table} Reference to this in order to allow method chaining
setShowOverlay(bShowOverlay): sap.m.Table
Sets a new value for property showOverlay.

Setting this property to true will show an overlay on top of the table content and prevents the user interaction with it.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
{boolean}bShowOverlay New value for property showOverlay
Since:
1.22.1
Returns:
{sap.m.Table} Reference to this in order to allow method chaining