class sap.ui.table.TablePersoController

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/table/TablePersoController
Application Component: CA-UI5-TBL

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


Constructor

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#constructor for a general description of the syntax of the settings object.

new sap.ui.table.TablePersoController(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
autoSave boolean true

Auto save state

Visibility: public
customDataKey string persoKey

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.

Visibility: public
persoService any

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/)

Visibility: public
resetAllMode sap.ui.table.ResetAllMode Default

Controls the behavior of the Reset button of the TablePersoDialog.
The value must be specified in the constructor and cannot be set or modified later.
If set to Default, the Reset button sets the table back to the initial state of the attached table when the controller is activated.
If set to ServiceDefault, the Reset button goes back to the initial settings of persoService.
If set to ServiceReset, the Reset button calls the getResetPersData of the attached persoService and uses it to reset the table.

Visibility: public
showResetAll boolean true

Controls the visibility of the Reset button of the TablePersoDialog.

Visibility: public

Associations

Name Cardinality Type Description
table 0..1 sap.ui.table.Table

The target table of this controller.


Methods Overview

Method Description
sap.ui.table.TablePersoController.extend

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.

getAutoSave

Gets current value of property autoSave.

Auto save state

Default value is true.

getCustomDataKey

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".

sap.ui.table.TablePersoController.getMetadata

Returns a metadata object for class sap.ui.table.TablePersoController.

getPersoService

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/)

getResetAllMode

Gets current value of property resetAllMode.

Controls the behavior of the Reset button of the TablePersoDialog.
The value must be specified in the constructor and cannot be set or modified later.
If set to Default, the Reset button sets the table back to the initial state of the attached table when the controller is activated.
If set to ServiceDefault, the Reset button goes back to the initial settings of persoService.
If set to ServiceReset, the Reset button calls the getResetPersData of the attached persoService and uses it to reset the table.

Default value is Default.

getShowResetAll

Gets current value of property showResetAll.

Controls the visibility of the Reset button of the TablePersoDialog.

Default value is true.

getTable

ID of the element which is the current target of the association table, or null.

openDialog

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.

refresh

Refresh the personalizations (reloads data from service).

savePersonalizations

Saves the current personalization state.

setAutoSave

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.

setCustomDataKey

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".

setPersoService

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.

setResetAllMode

Sets a new value for property resetAllMode.

Controls the behavior of the Reset button of the TablePersoDialog.
The value must be specified in the constructor and cannot be set or modified later.
If set to Default, the Reset button sets the table back to the initial state of the attached table when the controller is activated.
If set to ServiceDefault, the Reset button goes back to the initial settings of persoService.
If set to ServiceReset, the Reset button calls the getResetPersData of the attached persoService and uses it to reset the table.

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

Default value is Default.

setShowResetAll

Sets a new value for property showResetAll.

Controls the visibility of the Reset button of the TablePersoDialog.

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

Default value is true.

setTable

Sets the associated table.

sap.ui.table.TablePersoController.extend

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.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getAutoSave

Gets current value of property autoSave.

Auto save state

Default value is true.

getCustomDataKey

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".

sap.ui.table.TablePersoController.getMetadata

Returns a metadata object for class sap.ui.table.TablePersoController.

getPersoService

Gets current value of property persoService.

Personalization Service object. Needs to have the following methods:

getResetAllMode

Gets current value of property resetAllMode.

Controls the behavior of the Reset button of the TablePersoDialog.
The value must be specified in the constructor and cannot be set or modified later.
If set to Default, the Reset button sets the table back to the initial state of the attached table when the controller is activated.
If set to ServiceDefault, the Reset button goes back to the initial settings of persoService.
If set to ServiceReset, the Reset button calls the getResetPersData of the attached persoService and uses it to reset the table.

Default value is Default.

getShowResetAll

Gets current value of property showResetAll.

Controls the visibility of the Reset button of the TablePersoDialog.

Default value is true.

getTable

ID of the element which is the current target of the association table, or null.

openDialog

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.

Param Type DefaultValue Description
mSettings object

refresh

Refresh the personalizations (reloads data from service).

savePersonalizations

Saves the current personalization state.

setAutoSave

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.

Param Type DefaultValue Description
bAutoSave boolean true

New value for property autoSave

setCustomDataKey

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".

Param Type DefaultValue Description
sCustomDataKey string "persoKey"

New value for property customDataKey

setPersoService

Sets a new value for property persoService.

Personalization Service object. Needs to have the following methods:

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

Param Type DefaultValue Description
oPersoService any

New value for property persoService

setResetAllMode

Sets a new value for property resetAllMode.

Controls the behavior of the Reset button of the TablePersoDialog.
The value must be specified in the constructor and cannot be set or modified later.
If set to Default, the Reset button sets the table back to the initial state of the attached table when the controller is activated.
If set to ServiceDefault, the Reset button goes back to the initial settings of persoService.
If set to ServiceReset, the Reset button calls the getResetPersData of the attached persoService and uses it to reset the table.

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

Default value is Default.

Param Type DefaultValue Description
sResetAllMode sap.ui.table.ResetAllMode Default

New value for property resetAllMode

setShowResetAll

Sets a new value for property showResetAll.

Controls the visibility of the Reset button of the TablePersoDialog.

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

Default value is true.

Param Type DefaultValue Description
bShowResetAll boolean true

New value for property showResetAll

setTable

Sets the associated table.

Param Type DefaultValue Description
oTable sap.ui.core.ID sap.ui.table.Table

ID of an element which becomes the new target of this table association; alternatively, an element instance may be given