diff --git a/cspell.json b/cspell.json
index d15ae332c6..a34ba087dd 100644
--- a/cspell.json
+++ b/cspell.json
@@ -80,6 +80,7 @@
"jsons",
"Inplace",
"MLTEXT",
+ "mousedrag",
"mouseenter",
"multiselect",
"mysites",
@@ -122,6 +123,7 @@
"uncheck",
"Unclaim",
"unfavorite",
+ "unlisten",
"unshare",
"UPDATEPERMISSIONS",
"uploader",
diff --git a/docs/core/components/data-column.component.md b/docs/core/components/data-column.component.md
index fa75b7e5cb..e0f5e4d16d 100644
--- a/docs/core/components/data-column.component.md
+++ b/docs/core/components/data-column.component.md
@@ -60,6 +60,7 @@ Defines column properties for DataTable, Tasklist, Document List and other compo
| srTitle | `string` | | Title to be used for screen readers. |
| title | `string` | "" | Display title of the column, typically used for column headers. You can use the i18n resource key to get it translated automatically. |
| type | `string` | "text" | Value type for the column. Possible settings are 'text', 'image', 'date', 'fileSize', 'location', and 'json'. |
+| width | `number` | | size of the column in pixels |
## Details
diff --git a/docs/core/components/datatable.component.md b/docs/core/components/datatable.component.md
index 1bd4ad01c8..fcad5c1dbe 100644
--- a/docs/core/components/datatable.component.md
+++ b/docs/core/components/datatable.component.md
@@ -388,6 +388,7 @@ Learm more about styling your datatable: [Customizing the component's styles](#c
| showMainDatatableActions | `boolean` | false | Toggles the main datatable action. |
| sorting | `any[]` | \[] | Define the sort order of the datatable. Possible values are : [`created`, `desc`], [`created`, `asc`], [`due`, `desc`], [`due`, `asc`] |
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
+| isResizingEnabled | `boolean` | false | Toggles column resizing feature. |
### Events
@@ -873,3 +874,19 @@ You can define the tooltip format for cells of type date using a configuration i
- [Pagination component](pagination.component.md)
- [Data Table Adapter interface](../interfaces/datatable-adapter.interface.md)
- [Document list component](../../content-services/components/document-list.component.md)
+
+#### Column Resizing
+
+It is possible to have the ability to resize columns by clicking on the right border of each column and dragging it to the left.
+You can do this by setting the `isResizingEnabled` property of your datatable to `true`:
+
+```html
+
+
+```
+
+Once set up, the column resizing behaves as shown in the image below:
+
+
diff --git a/docs/docassets/images/datatable-column-resizing.png b/docs/docassets/images/datatable-column-resizing.png
new file mode 100644
index 0000000000..e8569d4648
Binary files /dev/null and b/docs/docassets/images/datatable-column-resizing.png differ
diff --git a/e2e/protractor.excludes.json b/e2e/protractor.excludes.json
index 86043f9a08..a70f4d2751 100644
--- a/e2e/protractor.excludes.json
+++ b/e2e/protractor.excludes.json
@@ -7,5 +7,10 @@
"C260377": "https://alfresco.atlassian.net/browse/ACS-4467",
"C260375": "https://alfresco.atlassian.net/browse/ACS-4467",
"C286290": "https://alfresco.atlassian.net/browse/ACS-4467",
- "C286472": "https://alfresco.atlassian.net/browse/ACS-4467"
+ "C286472": "https://alfresco.atlassian.net/browse/ACS-4467",
+ "C260387": "https://alfresco.atlassian.net/browse/ACS-4595",
+ "C216430": "https://alfresco.atlassian.net/browse/ACS-4595",
+ "C280063": "https://alfresco.atlassian.net/browse/ACS-4595",
+ "C280064": "https://alfresco.atlassian.net/browse/ACS-4595",
+ "C280407": "https://alfresco.atlassian.net/browse/ACS-4595"
}
diff --git a/lib/core/src/lib/datatable/components/datatable/datatable.component.html b/lib/core/src/lib/datatable/components/datatable/datatable.component.html
index f058733bf7..6fe0ea69e4 100644
--- a/lib/core/src/lib/datatable/components/datatable/datatable.component.html
+++ b/lib/core/src/lib/datatable/components/datatable/datatable.component.html
@@ -30,13 +30,16 @@
*ngFor="
let col of (data.getColumns() | filterOutEvery:'isHidden':true);
let columnIndex = index"
- [class.adf-sortable]="col.sortable"
[attr.data-automation-id]="'auto_id_' + col.key"
- [class.adf-datatable__header--sorted-asc]="isColumnSorted(col, 'asc')"
- [class.adf-datatable__header--sorted-desc]="isColumnSorted(col, 'desc')"
+ [ngClass]="{
+ 'adf-sortable': col.sortable,
+ 'adf-datatable__cursor--pointer': !isResizing,
+ 'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
+ 'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
+ [ngStyle]="(col.width) && {'flex': '0 1 ' + col.width + 'px' }"
[attr.aria-label]="col.title | translate"
- (click)="onColumnHeaderClick(col)"
- (keyup.enter)="onColumnHeaderClick(col)"
+ (click)="onColumnHeaderClick(col, $event)"
+ (keyup.enter)="onColumnHeaderClick(col, $event)"
role="columnheader"
[attr.tabindex]="isHeaderVisible() ? 0 : null"
[attr.aria-sort]="col.sortable ? (getAriaSort(col) | translate) : null"
@@ -51,12 +54,20 @@
adf-drop-zone dropTarget="header" [dropColumn]="col">
-
+
+