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 |
Returns a metadata object for class sap.m.TablePersoController.
Returns:
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. |
Adds some table into the association tables
.
Parameters:
{string|sap.m.Table} | vTable | the tables to add; if empty, nothing is inserted |
Returns:
applyPersonalizations(oTable)
Applies the personalizations by getting the existing personalizations and adjusting to the table.
Parameters:
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:
Destroys the persoService in the aggregation persoService
.
Returns:
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:
exit()
Do some clean up: remove event delegates, etc
Fires event personalizationsDone
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
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 |
Gets current value of property
contentHeight
.
Default value is 20rem
.
Returns:
Gets current value of property contentWidth
.
Returns:
getHasGrouping(): boolean
Gets current value of property
hasGrouping
.
Default value is false
.
Returns:
{boolean} | Value of property hasGrouping |
Gets content of aggregation persoService
.
Returns:
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 |
ID of the element which is the current target of the association table
, or null
.
Returns:
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. |
Returns array of IDs of the elements which are the current targets of the association tables
.
Returns:
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.
Removes all the controls in the association named tables
.
Returns:
{sap.m.Table[]} | An array of the removed elements (might be empty) |
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:
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:
Returns:
{TablePersoController} | the TablePersoController instance. |
setContentWidth(sWidth): TablePersoController
Reflector for the controller's 'contentWidth' property.
Parameters:
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. |
Sets the aggregated persoService
.
Parameters:
{Object} | oPersoService | The persoService to set |
Returns:
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. |
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: