From 73b94a9fa841f4b89103050b09c065bb2dee31ad Mon Sep 17 00:00:00 2001 From: Batuhan Tomo Date: Tue, 28 May 2024 11:50:31 +0300 Subject: [PATCH 1/4] Fix #6691: fix default editMode value --- components/lib/datatable/DataTableBase.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/lib/datatable/DataTableBase.js b/components/lib/datatable/DataTableBase.js index 76277da93f..25f9c50a64 100644 --- a/components/lib/datatable/DataTableBase.js +++ b/components/lib/datatable/DataTableBase.js @@ -328,7 +328,12 @@ const classes = { 'p-editable-column': editor, 'p-cell-editing': editor && editingState, 'p-frozen-column': frozen, - 'p-selectable-cell': props.allowCellSelection && props.isSelectable({ data: getCellParams(), index: props.rowIndex }), + 'p-selectable-cell': + props.allowCellSelection && + props.isSelectable({ + data: getCellParams(), + index: props.rowIndex + }), 'p-highlight': cellSelected, [`p-align-${align}`]: !!align }), @@ -337,7 +342,12 @@ const classes = { classNames({ 'p-highlight': (!props.allowCellSelection && props.selected) || props.contextMenuSelected, 'p-highlight-contextmenu': props.contextMenuSelected, - 'p-selectable-row': props.allowRowSelection && props.isSelectable({ data: props.rowData, index: props.rowIndex }), + 'p-selectable-row': + props.allowRowSelection && + props.isSelectable({ + data: props.rowData, + index: props.rowIndex + }), 'p-row-odd': props.rowIndex % 2 !== 0 }), rowGroupTogglerIcon: 'p-row-toggler-icon', @@ -441,7 +451,7 @@ export const DataTableBase = ComponentBase.extend({ dataKey: null, defaultSortOrder: 1, dragSelection: false, - editMode: null, + editMode: 'cell', editingRows: null, emptyMessage: null, expandableRowGroups: false, From 29e0b238b454328fd4529d69ab6980f448c880a6 Mon Sep 17 00:00:00 2001 From: Batuhan Tomo Date: Tue, 28 May 2024 17:55:04 +0300 Subject: [PATCH 2/4] Revert "Fix #6691: fix default editMode value" This reverts commit 73b94a9fa841f4b89103050b09c065bb2dee31ad. --- components/lib/datatable/DataTableBase.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/components/lib/datatable/DataTableBase.js b/components/lib/datatable/DataTableBase.js index 25f9c50a64..76277da93f 100644 --- a/components/lib/datatable/DataTableBase.js +++ b/components/lib/datatable/DataTableBase.js @@ -328,12 +328,7 @@ const classes = { 'p-editable-column': editor, 'p-cell-editing': editor && editingState, 'p-frozen-column': frozen, - 'p-selectable-cell': - props.allowCellSelection && - props.isSelectable({ - data: getCellParams(), - index: props.rowIndex - }), + 'p-selectable-cell': props.allowCellSelection && props.isSelectable({ data: getCellParams(), index: props.rowIndex }), 'p-highlight': cellSelected, [`p-align-${align}`]: !!align }), @@ -342,12 +337,7 @@ const classes = { classNames({ 'p-highlight': (!props.allowCellSelection && props.selected) || props.contextMenuSelected, 'p-highlight-contextmenu': props.contextMenuSelected, - 'p-selectable-row': - props.allowRowSelection && - props.isSelectable({ - data: props.rowData, - index: props.rowIndex - }), + 'p-selectable-row': props.allowRowSelection && props.isSelectable({ data: props.rowData, index: props.rowIndex }), 'p-row-odd': props.rowIndex % 2 !== 0 }), rowGroupTogglerIcon: 'p-row-toggler-icon', @@ -451,7 +441,7 @@ export const DataTableBase = ComponentBase.extend({ dataKey: null, defaultSortOrder: 1, dragSelection: false, - editMode: 'cell', + editMode: null, editingRows: null, emptyMessage: null, expandableRowGroups: false, From 91d94e988cf124fb8912f23e106335ae7f7bd5a0 Mon Sep 17 00:00:00 2001 From: Batuhan Tomo Date: Tue, 28 May 2024 17:57:38 +0300 Subject: [PATCH 3/4] Fix #6691: update docs --- components/doc/common/apidoc/index.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/doc/common/apidoc/index.json b/components/doc/common/apidoc/index.json index fda578fbf5..353accd566 100644 --- a/components/doc/common/apidoc/index.json +++ b/components/doc/common/apidoc/index.json @@ -16584,7 +16584,7 @@ "optional": true, "readonly": false, "type": "string", - "default": "cell", + "default": "null", "description": "Defines editing mode, options are \"cell\" and \"row\"." }, { @@ -57603,4 +57603,4 @@ } } } -} \ No newline at end of file +} From 98a2a279d6835572809010268dd9f6db7aeb0a3a Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 28 May 2024 11:29:55 -0400 Subject: [PATCH 4/4] Update datatable.d.ts --- components/lib/datatable/datatable.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/datatable/datatable.d.ts b/components/lib/datatable/datatable.d.ts index d04f01614d..cd17603db6 100644 --- a/components/lib/datatable/datatable.d.ts +++ b/components/lib/datatable/datatable.d.ts @@ -1081,7 +1081,7 @@ interface DataTableBaseProps extends Omit