mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
node-click and node-dblclick DOM events (#1863)
Extra DOM events with bubbling support for DocumentList: - node-click - node-dblclick
This commit is contained in:
committed by
Eugenio Romano
parent
5c7d53230d
commit
07d898b2aa
@@ -206,6 +206,42 @@ _For a complete example source code please refer to
|
||||
[DocumentList Demo](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-documentlist/demo)
|
||||
repository._
|
||||
|
||||
### DOM Events
|
||||
|
||||
Below are the DOM events the DocumentList component emits.
|
||||
All of them are `bubbling`, meaning you can handle them in any component up the parent hierarchy, even if DocumentList is wrapped by another component(s).
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| node-click | Raised when user clicks the node |
|
||||
| node-dblclick | Raised when user double-clicks the node |
|
||||
|
||||
Every event is represented by a [CustomEvent](https://developer.mozilla.org/en/docs/Web/API/CustomEvent) instance, having at least the following properties as part of the `Event.detail` property value:
|
||||
|
||||
```ts
|
||||
{
|
||||
sender: DocumentListComponent,
|
||||
node: MinimalNodeEntity
|
||||
}
|
||||
```
|
||||
|
||||
#### Handling DOM events
|
||||
|
||||
Here's a basic example on handling DOM events in the parent elements:
|
||||
|
||||
```html
|
||||
<div (node-click)="onNodeClicked($event)"
|
||||
(node-dblclick)="onNodeDblClicked($event)">
|
||||
<div>
|
||||
<alfresco-upload-drag-area ...>
|
||||
<alfresco-document-list ...>
|
||||
...
|
||||
</alfresco-document-list>
|
||||
</alfresco-upload-drag-area>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Setting default folder
|
||||
|
||||
You can set current folder path by assigning a value for `currentFolderId` property.
|
||||
|
Reference in New Issue
Block a user