This module should be mixed into renderers that wish to be able to either display selected state or that
can be clicked to change selected state. This is mixed into both the Selector
and Thumbnail renderers.
- Since:
- 1.0.40
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Members
-
itemKey :string
-
The dot-notation property in the currentItem that uniquely idenfities that item. This defaults to "nodeRef" as the most likely use case is for working with Nodes but this can be configured to a different value.
Type:
- string
- Default Value:
- "nodeRef"
- Source:
-
publishGlobal :boolean
-
Indicates whether the subscriptions made by createItemSelectionSubscriptions and the publications made by select and deselect should be made on the global scope.
Type:
- boolean
- Default Value:
- null
- Source:
-
publishToParent :boolean
-
Indicates whether the subscriptions made by createItemSelectionSubscriptions and the publications made by select and deselect should be made on the parent scope.
Type:
- boolean
- Default Value:
- null
- Source:
-
selectedCssClass :string
-
The CSS class to apply to the root DOM node of the widget
Type:
- string
- Default Value:
- "alfresco-lists-ItemSelectionMixin--selected"
- Source:
-
selectOnClick :boolean
-
This indicates whether or not clicking on the widget mixed by this module will trigger it's selection (it might be preferred to just update the CSS classes on selection rather than actually enabling item selection).
Type:
- boolean
- Default Value:
- true
- Source:
-
updateOnSelection :boolean
-
This indicates whether or not the mixing widget should subscribe to item selection events. This attribute is inspected by the createItemSelectionSubscriptions function to determine whether to bind the documentSelectionTopic to the [onItemSelection]module:alfresco/lists/ItemSelectionMixin#onItemSelection function.
Type:
- boolean
- Default Value:
- true
- Source:
Methods
-
createItemSelectionSubscriptions()
-
If updateOnSelection is configured to be true then this will setup the necessary subscriptions for item selection handling. Each time items are selected [onItemSelection]{@link module:alfresco/lists/ItemSelectionMixin#onItemSelection} will be called.
- Source:
Listens to Events:
-
deselect(selfProcessing)
-
Updates the CSS classes to indicate that the item has been de-selected and publishes the topic to indicate that an item has been de-selected.
Parameters:
Name Type Argument Default Description selfProcessing
boolean <optional>
false Indicates whether or not the subscriber should only handle publications made by itself - Source:
Fires:
-
getSelectionPublishGlobal() → {boolean}
-
Returns whether or not selection subscriptions and publications should be made globally. By default this returns publishGlobal.
- Source:
Returns:
A boolean indicating whether or not to publish and subscribe to selection topics globally.- Type
- boolean
-
getSelectionPublishToParent() → {boolean}
-
Returns whether or not selection subscriptions and publications should be made globally. By default this returns publishToParent.
- Source:
Returns:
A boolean indicating whether or not to publish and subscribe to selection topics to the parent scope.- Type
- boolean
-
onIndividualItemSelection(select, payload)
-
Handles the individual selection or deselection of an object.
Parameters:
Name Type Description select
boolean Indicates if this is a selection action payload
object The payload containing the details of the item selected Properties
Name Type Argument Default Description selfProcessing
boolean <optional>
false Indicates whether or not to only respond to requests initiated from the current instance requester
object <optional>
null The instance that originated this request value
object <optional>
The item to be selected or deselected - Source:
-
onItemSelection(payload)
-
Handles selection request events for the following values: "selectAll", "selectNone", "selectInvert", "selectFolders" & "selectDocuments". All other selection requests are ignored.
Parameters:
Name Type Description payload
object The details of the selection request. - Source:
-
onSelectionClick()
-
If selectOnClick is configured to be true then this will call either deselect or select (depending upon the current state).
- Source:
-
select(selfProcessing)
-
Updates the CSS classes to indicate that the item has been selected and publishes the topic to indicate that an item has been selected.
Parameters:
Name Type Argument Default Description selfProcessing
boolean <optional>
false Indicates whether or not the subscriber should only handle publications made by itself - Source:
Fires: