Class sap.m.TablePersoControllerModule: sap/m/TablePersoController


Table Personalization Controller

Constructor Summary
new sap.m.TablePersoController(sId?, mSettings?)The TablePersoController can be used to connect a table that you want to provide a personalization dialog for, with a persistence service such as one provided by the unified shell.
Event Summary
personalizationsDone(oControlEvent)
Method Summary
sap.m.TablePersoController.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.TablePersoController with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.TablePersoController.getMetadata()Returns a metadata object for class sap.m.TablePersoController.
activate()Activates the controller, i.e.
addTable(vTable)Adds some table into the association tables.
applyPersonalizations(oTable)Applies the personalizations by getting the existing personalizations and adjusting to the table.
attachPersonalizationsDone(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the personalizationsDone event of this sap.m.TablePersoController.
destroyPersoService()Destroys the persoService in the aggregation persoService.
detachPersonalizationsDone(fnFunction, oListener)Detaches event handler fnFunction from the personalizationsDone event of this sap.m.TablePersoController.
exit()Do some clean up: remove event delegates, etc
firePersonalizationsDone(mArguments?)Fires event personalizationsDone to attached listeners.
getComponentName()Gets current value of property componentName.
getContentHeight()Gets current value of property contentHeight.
getContentWidth()Gets current value of property contentWidth.
getHasGrouping()Gets current value of property hasGrouping.
getPersoService()Gets content of aggregation persoService.
getShowResetAll()Gets current value of property showResetAll.
getShowSelectAll()Gets current value of property showSelectAll.
getTable()ID of the element which is the current target of the association table, or null.
getTablePersoDialog()Returns a _tablePersoDialog instance if available.
getTables()Returns array of IDs of the elements which are the current targets of the association tables.
init()Initializes the TablePersoController instance after creation.
openDialog()Opens the TablePersoDialog, stores the personalized settings on close, modifies the table columns, and sends them to the persistence service
refresh()Refresh the personalizations: reloads the personalization information from the table perso provider, applies it to the controller's table and updates the controller's table perso dialog.
removeAllTables()Removes all the controls in the association named tables.
removeTable(vTable)Removes an table from the association named tables.
savePersonalizations()Persist the personalizations
setComponentName(sCompName)Using this method, the first part of tablePerso persistence ids can be provided, in case the table's app does not provide that part itself.
setContentHeight(sHeight)Reflector for the controller's 'contentHeight' property.
setContentWidth(sWidth)Reflector for the controller's 'contentWidth' property.
setHasGrouping(bHasGrouping)Reflector for the controller's 'hasGrouping' property.
setPersoService(oPersoService)Sets the aggregated persoService.
setShowResetAll(bShowResetAll)Reflector for the controller's 'showResetAll' property.
setShowSelectAll(bShowSelectAll)Reflector for the controller's 'showSelectAll' property.
setTable(oTable)Sets the associated table.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.m.TablePersoController(sId?, mSettings?)
The TablePersoController can be used to connect a table that you want to provide a personalization dialog for, with a persistence service such as one provided by the unified shell.

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? optional id for the new control; generated automatically if no non-empty id is given Note: this can be omitted, no matter whether mSettings will be given or not!
{object}mSettings? optional map/JSON-object with initial settings for the new component instance
Event Detail
personalizationsDone(oControlEvent)
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.m.TablePersoController.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.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.m.TablePersoController.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.TablePersoController.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
activate(): TablePersoController
Activates the controller, i.e. tries to retrieve existing persisted personalizations, creates a TablePersoDialog for the associated table and attaches a close handler to apply the personalizations to the table and persist them.

This method should be called when the table to be personalized knows its columns. Usually, this is when that table's view has set its model, which is typically done in the corresponding controller's init method. For example


 onInit: function () {

		// set explored app's demo model on this sample
		var oModel = new JSONModel(jQuery.sap.getModulePath("sap.ui.demo.mock", "/products.json"));
		var oGroupingModel = new JSONModel({ hasGrouping: false});
		this.getView().setModel(oModel);
		this.getView().setModel(oGroupingModel, 'Grouping');

		// init and activate controller
		this._oTPC = new TablePersoController({
			table: this.getView().byId("productsTable"),
			//specify the first part of persistence ids e.g. 'demoApp-productsTable-dimensionsCol'
			componentName: "demoApp",
			persoService: DemoPersoService,
		}).activate();
	}
Returns:
{TablePersoController} the TablePersoController instance.
addTable(vTable): sap.m.TablePersoController
Adds some table into the association tables.
Parameters:
{string|sap.m.Table}vTable the tables to add; if empty, nothing is inserted
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
applyPersonalizations(oTable)
Applies the personalizations by getting the existing personalizations and adjusting to the table.
Parameters:
{sap.m.Table}oTable the table to be personalized.
attachPersonalizationsDone(oData?, fnFunction, oListener?): sap.m.TablePersoController
Attaches event handler fnFunction to the personalizationsDone event of this sap.m.TablePersoController.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.TablePersoController itself.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.TablePersoController itself
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
destroyPersoService(): sap.m.TablePersoController
Destroys the persoService in the aggregation persoService.
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
detachPersonalizationsDone(fnFunction, oListener): sap.m.TablePersoController
Detaches event handler fnFunction from the personalizationsDone event of this sap.m.TablePersoController.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
exit()
Do some clean up: remove event delegates, etc
firePersonalizationsDone(mArguments?): sap.m.TablePersoController
Fires event personalizationsDone to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
getComponentName(): string
Gets current value of property componentName.

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

Returns:
{string} Value of property componentName
getContentHeight(): sap.ui.core.CSSSize
Gets current value of property contentHeight.

Default value is 20rem.

Returns:
{sap.ui.core.CSSSize} Value of property contentHeight
getContentWidth(): sap.ui.core.CSSSize
Gets current value of property contentWidth.
Returns:
{sap.ui.core.CSSSize} Value of property contentWidth
getHasGrouping(): boolean
Gets current value of property hasGrouping.

Default value is false.

Returns:
{boolean} Value of property hasGrouping
getPersoService(): Object
Gets content of aggregation persoService.
Returns:
{Object}
getShowResetAll(): boolean
Gets current value of property showResetAll.

Default value is true.

Returns:
{boolean} Value of property showResetAll
getShowSelectAll(): boolean
Gets current value of property showSelectAll.

Default value is true.

Returns:
{boolean} Value of property showSelectAll
getTable(): sap.m.Table
ID of the element which is the current target of the association table, or null.
Returns:
{sap.m.Table}
getTablePersoDialog(): TablePersoDialog
Returns a _tablePersoDialog instance if available. It can be NULL if the controller has not been activated yet.

This function makes a private aggregate publicly accessable. This is necessary for downward compatibility reasons: in the first versions of the tablePersoProvider developers still worked with the TablePersoDialog directly, which is now not necessary any longer.

Returns:
{TablePersoDialog} the TablePersoDialog instance.
getTables(): sap.m.Table[]
Returns array of IDs of the elements which are the current targets of the association tables.
Returns:
{sap.m.Table[]}
init()
Initializes the TablePersoController instance after creation.
openDialog()
Opens the TablePersoDialog, stores the personalized settings on close, modifies the table columns, and sends them to the persistence service
refresh()
Refresh the personalizations: reloads the personalization information from the table perso provider, applies it to the controller's table and updates the controller's table perso dialog.

Use case for a 'refresh' call would be that the table which si personalized changed its columns during runtime, after personalization has been activated.

removeAllTables(): sap.m.Table[]
Removes all the controls in the association named tables.
Returns:
{sap.m.Table[]} An array of the removed elements (might be empty)
removeTable(vTable): sap.m.Table
Removes an table from the association named tables.
Parameters:
{int|string|sap.m.Table}vTable The tableto be removed or its index or ID
Returns:
{sap.m.Table} the removed table or null
savePersonalizations()
Persist the personalizations
setComponentName(sCompName): TablePersoController
Using this method, the first part of tablePerso persistence ids can be provided, in case the table's app does not provide that part itself.

If a component name is set using this method, it will be used, regardless of whether the table's app has a different component name or not.

Parameters:
{string}sCompName the new component name.
Returns:
{TablePersoController} the TablePersoController instance.
setContentHeight(sHeight): TablePersoController
Reflector for the controller's 'contentHeight' property.
Parameters:
{sap.ui.core.CSSSize}sHeight the new height of the TablePersoDialog.
Returns:
{TablePersoController} the TablePersoController instance.
setContentWidth(sWidth): TablePersoController
Reflector for the controller's 'contentWidth' property.
Parameters:
{sap.ui.core.CSSSize}sWidth the new width of the tablePersoDialog
Returns:
{TablePersoController} the TablePersoController instance.
setHasGrouping(bHasGrouping): TablePersoController
Reflector for the controller's 'hasGrouping' property.
Parameters:
{boolean}bHasGrouping is the tablePersoDialog displayed in grouping mode or not.
Returns:
{TablePersoController} the TablePersoController instance.
setPersoService(oPersoService): sap.m.TablePersoController
Sets the aggregated persoService.
Parameters:
{Object}oPersoService The persoService to set
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining
setShowResetAll(bShowResetAll): TablePersoController
Reflector for the controller's 'showResetAll' property.
Parameters:
{boolean}bShowResetAll is the tablePersoDialog's 'UndoPersonalization' button displayed or not.
Returns:
{TablePersoController} the TablePersoController instance.
setShowSelectAll(bShowSelectAll): TablePersoController
Reflector for the controller's 'showSelectAll' property.
Parameters:
{boolean}bShowSelectAll is the tablePersoDialog's 'Display All' checkbox displayed or not.
Returns:
{TablePersoController} the TablePersoController instance.
setTable(oTable): sap.m.TablePersoController
Sets the associated table.
Parameters:
{sap.m.Table}oTable Id of an element which becomes the new target of this table association; alternatively, an element instance may be given
Returns:
{sap.m.TablePersoController} Reference to this in order to allow method chaining