Class sap.ui.table.TablePersoControllerModule: sap/ui/table/TablePersoController


The TablePersoController can be used to connect a table with a persistence service.


Since: 1.21.1.
Constructor Summary
new sap.ui.table.TablePersoController(sId?, mSettings?)Constructor for a new TablePersoController.
Method Summary
sap.ui.table.TablePersoController.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.table.TablePersoController with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.table.TablePersoController.getMetadata()Returns a metadata object for class sap.ui.table.TablePersoController.
getAutoSave()Gets current value of property autoSave.
getCustomDataKey()Gets current value of property customDataKey.
getPersoService()Gets current value of property persoService.
getTable()ID of the element which is the current target of the association table, or null.
openDialog(mSettings)Opens the personalization dialog for the Table to modify the visibility and the order of the columns.
refresh()Refresh the personalizations (reloads data from service).
savePersonalizations()Saves the current personalization state.
setAutoSave(bAutoSave)Sets a new value for property autoSave.
setCustomDataKey(sCustomDataKey)Sets a new value for property customDataKey.
setPersoService(oPersoService)Sets a new value for property persoService.
setTable(oTable)Sets the associated table.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.table.TablePersoController(sId?, mSettings?)
Constructor for a new TablePersoController.

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.ui.base.ManagedObject 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.ui.table.TablePersoController.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.table.TablePersoController with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.ManagedObject.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.ui.table.TablePersoController.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.table.TablePersoController.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getAutoSave(): boolean
Gets current value of property autoSave.

Auto save state

Default value is true.

Returns:
{boolean} Value of property autoSave
getCustomDataKey(): string
Gets current value of property customDataKey.

By defining a custom data key the TablePersoController will try to get the key for saving the perso data from the custom data of the Table and Column instead of creating it by concatenating the ID of the Table and the Column. Basically this will be more stable than using the auto IDs.

Default value is persoKey.

Returns:
{string} Value of property customDataKey
getPersoService(): any
Gets current value of property persoService.

Personalization Service object. Needs to have the following methods:

  • getPersData() : jQuery Promise (http://api.jquery.com/promise/)
  • setPersData(oBundle) : jQuery Promise (http://api.jquery.com/promise/)
  • delPersData() : jQuery Promise (http://api.jquery.com/promise/)
Returns:
{any} Value of property persoService
getTable(): sap.ui.table.Table
ID of the element which is the current target of the association table, or null.
Returns:
{sap.ui.table.Table}
openDialog(mSettings)
Opens the personalization dialog for the Table to modify the visibility and the order of the columns.

Using this functionality will require to load the sap.m library because the personalization dialog is only available in this library for now.

Experimental API:since 1.21.2 - API might change / feature requires the sap.m library!

Parameters:
{object}mSettings
Experimental:
since 1.21.2 - API might change / feature requires the sap.m library!
refresh(): jQuery.Promise
Refresh the personalizations (reloads data from service).
Returns:
{jQuery.Promise}jQuery Promise which is resolved once the refresh is finished
savePersonalizations(): jQuery.Promise
Saves the current personalization state.
Returns:
{jQuery.Promise}jQuery Promise which is resolved once the save is finished
setAutoSave(bAutoSave): sap.ui.table.TablePersoController
Sets a new value for property autoSave.

Auto save state

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

Default value is true.

Parameters:
{boolean}bAutoSave New value for property autoSave
Returns:
{sap.ui.table.TablePersoController} Reference to this in order to allow method chaining
setCustomDataKey(sCustomDataKey): sap.ui.table.TablePersoController
Sets a new value for property customDataKey.

By defining a custom data key the TablePersoController will try to get the key for saving the perso data from the custom data of the Table and Column instead of creating it by concatenating the ID of the Table and the Column. Basically this will be more stable than using the auto IDs.

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

Default value is persoKey.

Parameters:
{string}sCustomDataKey New value for property customDataKey
Returns:
{sap.ui.table.TablePersoController} Reference to this in order to allow method chaining
setPersoService(oPersoService): sap.ui.table.TablePersoController
Sets a new value for property persoService.

Personalization Service object. Needs to have the following methods:

  • getPersData() : jQuery Promise (http://api.jquery.com/promise/)
  • setPersData(oBundle) : jQuery Promise (http://api.jquery.com/promise/)
  • delPersData() : jQuery Promise (http://api.jquery.com/promise/)

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

Parameters:
{any}oPersoService New value for property persoService
Returns:
{sap.ui.table.TablePersoController} Reference to this in order to allow method chaining
Sets the associated table.
Parameters:
{sap.ui.table.Table}oTable Id of an element which becomes the new target of this table association; alternatively, an element instance may be given
Returns:
{sap.ui.table.TablePersoController} Reference to this in order to allow method chaining