diff --git a/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json b/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json
new file mode 100644
index 0000000000..be432b69f1
--- /dev/null
+++ b/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when move tree node position code occor error #3645 #3706\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/3684-bug-frame-border-with-array_2025-04-07-03-54.json b/common/changes/@visactor/vtable/3684-bug-frame-border-with-array_2025-04-07-03-54.json
new file mode 100644
index 0000000000..5ef5a8be02
--- /dev/null
+++ b/common/changes/@visactor/vtable/3684-bug-frame-border-with-array_2025-04-07-03-54.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: frame border set array render bottom line position error #3684\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/3693-bug-mobile-touch-event-error_2025-04-03-06-30.json b/common/changes/@visactor/vtable/3693-bug-mobile-touch-event-error_2025-04-03-06-30.json
new file mode 100644
index 0000000000..98e04114ab
--- /dev/null
+++ b/common/changes/@visactor/vtable/3693-bug-mobile-touch-event-error_2025-04-03-06-30.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: mobile touch event resize column width #3693\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/3702-bug-disabledragselect-frozencolcount_2025-04-07-07-57.json b/common/changes/@visactor/vtable/3702-bug-disabledragselect-frozencolcount_2025-04-07-07-57.json
new file mode 100644
index 0000000000..f2133f76cb
--- /dev/null
+++ b/common/changes/@visactor/vtable/3702-bug-disabledragselect-frozencolcount_2025-04-07-07-57.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when set frozen disableDragSelect not work #3702\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/feat-changeCellValue_2025-04-08-13-35.json b/common/changes/@visactor/vtable/feat-changeCellValue_2025-04-08-13-35.json
new file mode 100644
index 0000000000..3b99a3abf0
--- /dev/null
+++ b/common/changes/@visactor/vtable/feat-changeCellValue_2025-04-08-13-35.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "feat: listTable added tiggerEvent parameter to changeCellValue\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "blinyo@163.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/feat-listtable-columntree_2025-04-03-10-14.json b/common/changes/@visactor/vtable/feat-listtable-columntree_2025-04-03-10-14.json
new file mode 100644
index 0000000000..e83ceffab6
--- /dev/null
+++ b/common/changes/@visactor/vtable/feat-listtable-columntree_2025-04-03-10-14.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "feat: list table header support hierarchy \n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-custom-flex-layout_2025-04-09-08-08.json b/common/changes/@visactor/vtable/fix-custom-flex-layout_2025-04-09-08-08.json
new file mode 100644
index 0000000000..61daf547f9
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-custom-flex-layout_2025-04-09-08-08.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: fix flex layout update in react-custom-layout component #3696",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-gantt-updateRecord_2025-04-07-11-35.json b/common/changes/@visactor/vtable/fix-gantt-updateRecord_2025-04-07-11-35.json
new file mode 100644
index 0000000000..65b05c424b
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-gantt-updateRecord_2025-04-07-11-35.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: updateTaskRecord api #3639\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/refactor-computeColsWidth_api_call_time_2025-04-09-06-31.json b/common/changes/@visactor/vtable/refactor-computeColsWidth_api_call_time_2025-04-09-06-31.json
new file mode 100644
index 0000000000..3a47be852c
--- /dev/null
+++ b/common/changes/@visactor/vtable/refactor-computeColsWidth_api_call_time_2025-04-09-06-31.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: repeat call computeColsWidth adaptive mode result error\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
diff --git a/docs/assets/api/en/methods.md b/docs/assets/api/en/methods.md
index 3974e4fda7..c2ac4a6125 100644
--- a/docs/assets/api/en/methods.md
+++ b/docs/assets/api/en/methods.md
@@ -1060,7 +1060,7 @@ Change the value of a cell:
```
/\*_ Set the value of the cell. Note that it corresponds to the original value of the source data, and the vtable instance records will be modified accordingly _/
-changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false) => void;
+changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false, triggerEvent = true) => void;
```
@@ -1077,7 +1077,7 @@ Change the value of cells in batches:
- @param row The starting row number of pasted data
- @param values Data array of multiple cells
\*/
- changeCellValues(startCol: number, startRow: number, values: string[][])
+ changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false, triggerEvent=true) => void;
```
diff --git a/docs/assets/api/zh/methods.md b/docs/assets/api/zh/methods.md
index 94e58cc911..7bf508a0a1 100644
--- a/docs/assets/api/zh/methods.md
+++ b/docs/assets/api/zh/methods.md
@@ -956,8 +956,15 @@ use case: 对于透视图的场景上,点击图例项后 更新过滤规则
更改单元格的 value 值:
```
- /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */
- changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false) => void;
+ /**
+ * 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改
+ * @param col 单元格的起始列号
+ * @param row 单元格的起始行号
+ * @param value 更改后的值
+ * @param workOnEditableCell 是否仅更改可编辑单元格
+ * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件
+ */
+ changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false, triggerEvent = true) => void;
```
## changeCellValues(Function)
@@ -971,8 +978,9 @@ use case: 对于透视图的场景上,点击图例项后 更新过滤规则
* @param row 粘贴数据的起始行号
* @param values 多个单元格的数据数组
* @param workOnEditableCell 是否仅更改可编辑单元格
+ * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件
*/
- changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false)
+ changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false, triggerEvent=true) => void;
```
## getEditor(Function)
diff --git a/docs/assets/demo/en/basic-functionality/list-table-header-group-collapse.md b/docs/assets/demo/en/basic-functionality/list-table-header-group-collapse.md
new file mode 100644
index 0000000000..782e9b8312
--- /dev/null
+++ b/docs/assets/demo/en/basic-functionality/list-table-header-group-collapse.md
@@ -0,0 +1,115 @@
+---
+category: examples
+group: Basic Features
+title: List Table - Header Group Collapse
+cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/list-table-header-group.png
+link: table-type/list-table
+option: ListTable-columns-text#columns
+---
+
+# List Table - Header Group Collapse
+
+Configure columns as a nested multi-layer structure to achieve multi-layer header grouping effects. Enable tree-style expansion and collapse functionality through `headerHierarchyType: 'grid-tree'`, and set the default expansion level with `headerExpandLevel`.
+
+## Key Configurations
+
+- columns
+- `headerHierarchyType` Set hierarchy display to `grid-tree` to enable tree-style expand/collapse
+- `headerExpandLevel` Configure default expansion level (defaults to 1)
+
+## Code demo
+
+```javascript livedemo template=vtable
+let tableInstance;
+const records = [
+ {
+ id: 1,
+ name: 'name.1',
+ name_1: 'name_1.1',
+ name_2: 'name_2.1',
+ name_2_1: 'name_2_1.1',
+ name_2_2: 'name_2_2.1'
+ },
+ {
+ id: 2,
+ name: 'name.2',
+ name_1: 'name_1.2',
+ name_2: 'name_2.2',
+ name_2_1: 'name_2_1.2',
+ name_2_2: 'name_2_2.2'
+ },
+ {
+ id: 3,
+ name: 'name.3',
+ name_1: 'name_1.3',
+ name_2: 'name_2.3',
+ name_2_1: 'name_2_1.3',
+ name_2_2: 'name_2_2.3'
+ },
+ {
+ id: 4,
+ name: 'name.4',
+ name_1: 'name_1.4',
+ name_2: 'name_2.4',
+ name_2_1: 'name_2_1.4',
+ name_2_2: 'name_2_2.4'
+ },
+ {
+ id: 5,
+ name: 'name.5',
+ name_1: 'name_1.5',
+ name_2: 'name_2.5',
+ name_2_1: 'name_2_1.5',
+ name_2_2: 'name_2_2.5'
+ }
+];
+
+const columns = [
+ {
+ field: 'id',
+ title: 'ID',
+ width: 100
+ },
+ {
+ field: 'name',
+ title: 'Name',
+ columns: [
+ {
+ field: 'name_1',
+ title: 'Name_1',
+ width: 120
+ },
+ {
+ field: 'name_2',
+ title: 'Name_2',
+ width: 150,
+ columns: [
+ {
+ field: 'name_2_1',
+ title: 'Name_2_1',
+ width: 150
+ },
+ {
+ field: 'name_2_2',
+ title: 'Name_2_2',
+ width: 150
+ }
+ ]
+ }
+ ]
+ }
+];
+
+const option = {
+ records,
+ columns,
+ headerHierarchyType: 'grid-tree',
+ headerExpandLevel: 3,
+ widthMode: 'standard',
+ autoWrapText: true,
+ autoRowHeight: true,
+ defaultColWidth: 150
+};
+tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
+window['tableInstance'] = tableInstance;
+```
diff --git a/docs/assets/demo/en/component/dropdown.md b/docs/assets/demo/en/component/dropdown.md
index 8e237859f2..7aa2715a4b 100644
--- a/docs/assets/demo/en/component/dropdown.md
+++ b/docs/assets/demo/en/component/dropdown.md
@@ -11,7 +11,7 @@ option: ListTable-columns-text#dropDownMenu
# drop down menu
In this example, the dropDownMenu is configured in the first column of columns, and when hovered to the header cell, a drop-down menu is displayed for further operation.
-At the same time through monitoring`click_cell`Event, when the mouse clicks the order icon in the first column, the interface showDropDownMenu is called to display the drop-down menu. To continue the operation according to the item clicked on the drop-down menu, you can listen to the event dropdownmenu_click.
+At the same time through monitoring`click_cell`Event, when the mouse clicks the order icon in the first column, the interface showDropDownMenu is called to display the drop-down menu. To continue the operation according to the item clicked on the drop-down menu, you can listen to the event dropdown_menu_click.
## Key Configurations
diff --git a/docs/assets/demo/en/interaction/context-menu.md b/docs/assets/demo/en/interaction/context-menu.md
index c1f987733a..ceb4e41a0f 100644
--- a/docs/assets/demo/en/interaction/context-menu.md
+++ b/docs/assets/demo/en/interaction/context-menu.md
@@ -10,7 +10,7 @@ option: ListTable#menu.contextMenuItems
# Right click menu
-Right-click pop-up menu, if you need to click on the drop-down menu to continue the operation, you can listen to the event dropdownmenu_click.
+Right-click pop-up menu, if you need to click on the drop-down menu to continue the operation, you can listen to the event dropdown_menu_click.
In this example, after clicking the right mouse button, a copy, paste, delete and other functions will appear in the drop-down menu. After clicking the copy, the selected cell content will be copied to the clipboard, after clicking paste, the content in the clipboard will be pasted to the selected cell, and after clicking delete, the content of the selected cell will be set to empty.
diff --git a/docs/assets/demo/menu.json b/docs/assets/demo/menu.json
index 51b1716f84..465824021a 100644
--- a/docs/assets/demo/menu.json
+++ b/docs/assets/demo/menu.json
@@ -520,6 +520,13 @@
"en": "List Table - Header Group"
}
},
+ {
+ "path": "list-table-header-group-collapse",
+ "title": {
+ "zh": "基本表格表头分组与折叠",
+ "en": "List Table - Header Group Collapse"
+ }
+ },
{
"path": "auto-wrap-text",
"title": {
diff --git a/docs/assets/demo/zh/basic-functionality/list-table-header-group-collapse.md b/docs/assets/demo/zh/basic-functionality/list-table-header-group-collapse.md
new file mode 100644
index 0000000000..bf8500cf6a
--- /dev/null
+++ b/docs/assets/demo/zh/basic-functionality/list-table-header-group-collapse.md
@@ -0,0 +1,115 @@
+---
+category: examples
+group: Basic Features
+title: 基本表格表头分组与折叠
+cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/list-table-header-group.png
+link: table-type/list-table
+option: ListTable-columns-text#columns
+---
+
+# 基本表格表头分组与折叠
+
+将 columns 配置为嵌套多层结构来实现多层表头分组效果,可通过配置 `headerHierarchyType: 'grid-tree'` 开启树形的展开和折叠,并通过 `headerExpandLevel` 来设置默认展开层级。
+
+## 关键配置
+
+- columns
+- `headerHierarchyType` 将层级展示设置为 `grid-tree`,开启树形的展开和折叠功能
+- `headerExpandLevel` 设置默认展开层级,默认为`1`
+
+## 代码演示
+
+```javascript livedemo template=vtable
+let tableInstance;
+const records = [
+ {
+ id: 1,
+ name: 'name.1',
+ name_1: 'name_1.1',
+ name_2: 'name_2.1',
+ name_2_1: 'name_2_1.1',
+ name_2_2: 'name_2_2.1'
+ },
+ {
+ id: 2,
+ name: 'name.2',
+ name_1: 'name_1.2',
+ name_2: 'name_2.2',
+ name_2_1: 'name_2_1.2',
+ name_2_2: 'name_2_2.2'
+ },
+ {
+ id: 3,
+ name: 'name.3',
+ name_1: 'name_1.3',
+ name_2: 'name_2.3',
+ name_2_1: 'name_2_1.3',
+ name_2_2: 'name_2_2.3'
+ },
+ {
+ id: 4,
+ name: 'name.4',
+ name_1: 'name_1.4',
+ name_2: 'name_2.4',
+ name_2_1: 'name_2_1.4',
+ name_2_2: 'name_2_2.4'
+ },
+ {
+ id: 5,
+ name: 'name.5',
+ name_1: 'name_1.5',
+ name_2: 'name_2.5',
+ name_2_1: 'name_2_1.5',
+ name_2_2: 'name_2_2.5'
+ }
+];
+
+const columns = [
+ {
+ field: 'id',
+ title: 'ID',
+ width: 100
+ },
+ {
+ field: 'name',
+ title: 'Name',
+ columns: [
+ {
+ field: 'name_1',
+ title: 'Name_1',
+ width: 120
+ },
+ {
+ field: 'name_2',
+ title: 'Name_2',
+ width: 150,
+ columns: [
+ {
+ field: 'name_2_1',
+ title: 'Name_2_1',
+ width: 150
+ },
+ {
+ field: 'name_2_2',
+ title: 'Name_2_2',
+ width: 150
+ }
+ ]
+ }
+ ]
+ }
+];
+
+const option = {
+ records,
+ columns,
+ headerHierarchyType: 'grid-tree',
+ headerExpandLevel: 3,
+ widthMode: 'standard',
+ autoWrapText: true,
+ autoRowHeight: true,
+ defaultColWidth: 150
+};
+tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
+window['tableInstance'] = tableInstance;
+```
diff --git a/docs/assets/demo/zh/component/dropdown.md b/docs/assets/demo/zh/component/dropdown.md
index 88812b3a10..637e7182e6 100644
--- a/docs/assets/demo/zh/component/dropdown.md
+++ b/docs/assets/demo/zh/component/dropdown.md
@@ -11,7 +11,7 @@ option: ListTable-columns-text#dropDownMenu
# 下拉菜单
在该示例中,在 columns 第一列中配置了 dropDownMenu, 当 hover 到表头单元格时会显示下拉菜单以进行进一步操作。
-同时通过监听`click_cell`事件,鼠标点击第一列中订单 icon 时,调用接口 showDropDownMenu 来显示下拉菜单。如需根据点击下拉菜单的项目来继续操作,可以监听事件 dropdownmenu_click。
+同时通过监听`click_cell`事件,鼠标点击第一列中订单 icon 时,调用接口 showDropDownMenu 来显示下拉菜单。如需根据点击下拉菜单的项目来继续操作,可以监听事件 dropdown_menu_click。
## 关键配置
diff --git a/docs/assets/demo/zh/interaction/context-menu.md b/docs/assets/demo/zh/interaction/context-menu.md
index e8f3695573..2a80edf1b1 100644
--- a/docs/assets/demo/zh/interaction/context-menu.md
+++ b/docs/assets/demo/zh/interaction/context-menu.md
@@ -10,7 +10,7 @@ option: ListTable#menu.contextMenuItems
# 右键菜单
-右键弹出菜单, 如需根据点击下拉菜单的项目来继续操作,可以监听事件 dropdownmenu_click。
+右键弹出菜单, 如需根据点击下拉菜单的项目来继续操作,可以监听事件 dropdown_menu_click。
本例中,点击右键后会出现复制、粘贴、删除等功能的下拉菜单,点击复制后,会将选中的单元格内容复制到剪贴板,点击粘贴后,会将剪贴板中的内容粘贴到选中的单元格中,点击删除后,会将选中的单元格内容设置为空。
diff --git a/docs/assets/faq/en/16-How to customize the drop-down menu in table component.md b/docs/assets/faq/en/16-How to customize the drop-down menu in table component.md
index c2f8e4b1be..9ffaecf78d 100644
--- a/docs/assets/faq/en/16-How to customize the drop-down menu in table component.md
+++ b/docs/assets/faq/en/16-How to customize the drop-down menu in table component.md
@@ -58,11 +58,11 @@ menu: {
2. Configure in the header
dropDownMenu can be configured in columns. The items are the same as defaultHeaderMenuItems. The menu only takes effect in the corresponding column.
3. Menu selection status update
- After the drop-down menu item is selected, the "dropdownmenu_click" event will be triggered. The listening event updates the drop-down menu status through the setDropDownMenuHighlight interface. The selected item text and icon will change the style.
+ After the drop-down menu item is selected, the "dropdown_menu_click" event will be triggered. The listening event updates the drop-down menu status through the setDropDownMenuHighlight interface. The selected item text and icon will change the style.
```javascript
-table.on('dropdownmenu_click', (args: any) => {
- console.log('dropdownmenu_click', args);
+table.on('dropdown_menu_click', (args: any) => {
+ console.log('dropdown_menu_click', args);
table.setDropDownMenuHighlight([args]);
});
```
@@ -140,8 +140,8 @@ const option: TYPES.ListTableConstructorOptions = {
}
};
const table = new ListTable(document.getElementById('container'), option);
-table.on('dropdownmenu_click', (args: any) => {
- console.log('dropdownmenu_click', args);
+table.on('dropdown_menu_click', (args: any) => {
+ console.log('dropdown_menu_click', args);
table.setDropDownMenuHighlight([args]);
});
```
diff --git a/docs/assets/faq/en/18-How to customize the context menu in the table component.md b/docs/assets/faq/en/18-How to customize the context menu in the table component.md
index c3d5ec639b..753869eb55 100644
--- a/docs/assets/faq/en/18-How to customize the context menu in the table component.md
+++ b/docs/assets/faq/en/18-How to customize the context menu in the table component.md
@@ -38,10 +38,10 @@ Menu item configuration:
- text: the text of the menu item
- menuKey: unique identifier of the menu item
-After the drop-down menu item is selected, the "dropdownmenu_click" event will be triggered, and you can listen to the event and perform related operations.
+After the drop-down menu item is selected, the "dropdown_menu_click" event will be triggered, and you can listen to the event and perform related operations.
```javascript
-table.on('dropdownmenu_click', (args: any) => {
+table.on('dropdown_menu_click', (args: any) => {
console.log('menu_click', args);
});
```
@@ -65,7 +65,7 @@ const option: TYPES.ListTableConstructorOptions = {
}
};
const table = new ListTable(document.getElementById('container'), option);
-table.on('dropdownmenu_click', (args: any) => {
+table.on('dropdown_menu_click', (args: any) => {
console.log('menu_click', args);
});
```
diff --git a/docs/assets/faq/zh/16-How to customize the drop-down menu in table component.md b/docs/assets/faq/zh/16-How to customize the drop-down menu in table component.md
index 9683ef1b7f..d887811c69 100644
--- a/docs/assets/faq/zh/16-How to customize the drop-down menu in table component.md
+++ b/docs/assets/faq/zh/16-How to customize the drop-down menu in table component.md
@@ -58,11 +58,11 @@ menu: {
2. 在表头中配置
在 columns 中可以配置 dropDownMenu,项目与 defaultHeaderMenuItems 相同,该菜单只在对应的列中生效。
3. 菜单选中状态更新
- 下拉菜单项目选中后,会触发"dropdownmenu_click"事件,监听事件事件通过 setDropDownMenuHighlight 接口更新下拉菜单状态,选中的项目文字和 icon 会更改样式。
+ 下拉菜单项目选中后,会触发"dropdown_menu_click"事件,监听事件事件通过 setDropDownMenuHighlight 接口更新下拉菜单状态,选中的项目文字和 icon 会更改样式。
```javascript
-table.on('dropdownmenu_click', (args: any) => {
- console.log('dropdownmenu_click', args);
+table.on('dropdown_menu_click', (args: any) => {
+ console.log('dropdown_menu_click', args);
table.setDropDownMenuHighlight([args]);
});
```
@@ -140,8 +140,8 @@ const option: TYPES.ListTableConstructorOptions = {
}
};
const table = new ListTable(document.getElementById('container'), option);
-table.on('dropdownmenu_click', (args: any) => {
- console.log('dropdownmenu_click', args);
+table.on('dropdown_menu_click', (args: any) => {
+ console.log('dropdown_menu_click', args);
table.setDropDownMenuHighlight([args]);
});
```
diff --git a/docs/assets/faq/zh/18-How to customize the context menu in the table component.md b/docs/assets/faq/zh/18-How to customize the context menu in the table component.md
index 95eaf64ac5..517d9c4cc4 100644
--- a/docs/assets/faq/zh/18-How to customize the context menu in the table component.md
+++ b/docs/assets/faq/zh/18-How to customize the context menu in the table component.md
@@ -38,10 +38,10 @@ menu: {
- text: 菜单项目的文字
- menuKey: 菜单项目的唯一标识符
-下拉菜单项目选中后,会触发"dropdownmenu_click"事件,可以监听事件事件执行相关操作。
+下拉菜单项目选中后,会触发"dropdown_menu_click"事件,可以监听事件事件执行相关操作。
```javascript
-table.on('dropdownmenu_click', (args: any) => {
+table.on('dropdown_menu_click', (args: any) => {
console.log('menu_click', args);
});
```
@@ -65,7 +65,7 @@ const option: TYPES.ListTableConstructorOptions = {
}
};
const table = new ListTable(document.getElementById('container'), option);
-table.on('dropdownmenu_click', (args: any) => {
+table.on('dropdown_menu_click', (args: any) => {
console.log('menu_click', args);
});
```
diff --git a/docs/assets/guide/en/Event/event_list.md b/docs/assets/guide/en/Event/event_list.md
index ced2ecbcdf..4391c9eb27 100644
--- a/docs/assets/guide/en/Event/event_list.md
+++ b/docs/assets/guide/en/Event/event_list.md
@@ -33,7 +33,7 @@ For a more comprehensive list of events, please refer to: https://visactor.io/vt
| After sort | AFTER_SORT | Execute after sorting event |
| Click Fixed Column | FREEZE_CLICK | Click Fixed Column Icon Event |
| Scroll | SCROLL | Scroll Table Events |
-| Click the drop-down icon | DROPDOWNMENU_CLICK | Click the drop-down menu icon event |
+| Click the drop-down icon | DROPDOWN_MENU_CLICK | Click the drop-down menu icon event |
| Click on the drop-down menu | MENU_CLICK | Click on the drop-down menu Events |
| Mouse over miniature | MOUSEOVER_CHART_SYMBOL | Mouse over miniature mark events |
| Drag and drop box to select mouse release | DRAG_SELECT_END | Drag and drop box to select cell mouse release event |
diff --git a/docs/assets/guide/en/gantt/introduction.md b/docs/assets/guide/en/gantt/introduction.md
index e7eb24a496..725f1caab2 100644
--- a/docs/assets/guide/en/gantt/introduction.md
+++ b/docs/assets/guide/en/gantt/introduction.md
@@ -156,11 +156,6 @@ If there is no field data for the task date in the original data, you can create
The button style can be configured via `taskBar.scheduleCreation.buttonStyle`.
If the current configuration does not meet your needs, you can also customize the display effect of the creation schedule through the `taskBar.scheduleCreation.customLayout` configuration item.
-**Note: Different Gantt chart instances have different capabilities to create schedules.**
-
-When `tasksShowMode` is `TasksShowMode.Tasks_Separate` or `TasksShowMode.Sub_Tasks_Separate`, each piece of data has a corresponding row position display, but when there is no `startDate` and `endDate` field set in the data, a create button will appear when the mouse hovers over the row, and clicking the button will create a schedule and display the task bar.
-
-When `tasksShowMode` is `TasksShowMode.Sub_Tasks_Inline`, `TasksShowMode.Sub_Tasks_Arrange`, or `TasksShowMode.Sub_Tasks_Compact`, a create button will be displayed when the mouse hovers over the blank area, and clicking the button will trigger the event `GANTT_EVENT_TYPE.CREATE_TASK_SCHEDULE`, but it will not actually create a task schedule. The user needs to listen for this event and create a schedule update data according to business needs.
**Note: Different Gantt chart instances have different capabilities to create schedules.**
diff --git a/docs/assets/guide/en/table_type/List_table/columns_tree.md b/docs/assets/guide/en/table_type/List_table/columns_tree.md
new file mode 100644
index 0000000000..ecbb3f6b3e
--- /dev/null
+++ b/docs/assets/guide/en/table_type/List_table/columns_tree.md
@@ -0,0 +1,114 @@
+## Basic Table Header Grouping and Collapsing
+
+In this tutorial, we will learn how to implement multi-level header grouping and collapsing in VTable using a tree structure to visualize complex header hierarchies.
+
+---
+
+## Use Cases
+
+Header grouping and collapsing are suitable for the following scenarios:
+
+- **Multidimensional Data Analysis**: Combine related fields into logical groups (e.g., "Sales Data" includes sub-columns like "Revenue" and "Profit").
+- **Complex Data Structures**: Tables with explicit hierarchical relationships (e.g., "Region-Province-City" three-level structure).
+- **Space Optimization**: Improve readability by collapsing non-critical columns.
+- **Dynamic Interaction**: Allow users to expand/collapse specific groups on demand for flexible data exploration.
+
+---
+
+## Implementation Steps
+
+### 1. Configure Multi-Level Header Structure
+
+Define header hierarchies using nested structures in the `columns` configuration. Each group adds sub-columns via the `columns` field to form a tree relationship.
+
+### 2. Enable Tree-Style Collapsing
+
+Set `headerHierarchyType: 'grid-tree'` to enable interactive tree-style collapsing for headers.
+
+### 3. Set Default Expansion Level
+
+Specify the initial expansion level using `headerExpandLevel` (default: `1`, showing only the first-level groups).
+
+---
+
+## Example
+
+```javascript livedemo template=vtable
+const records = [
+ { region: 'North', province: 'Province A', city: 'City 1', revenue: 1000, cost: 600 },
+ { region: 'North', province: 'Province A', city: 'City 2', revenue: 1500, cost: 800 },
+ { region: 'South', province: 'Province B', city: 'City 3', revenue: 2000, cost: 1100 }
+];
+
+const columns = [
+ {
+ title: 'Region',
+ field: 'region',
+ width: 150,
+ columns: [
+ {
+ title: 'Province',
+ field: 'province',
+ width: 150,
+ columns: [
+ {
+ title: 'City',
+ field: 'city',
+ width: 150
+ }
+ ]
+ }
+ ]
+ },
+ {
+ title: 'Financial Metrics',
+ field: 'metrics',
+ width: 180,
+ columns: [
+ { title: 'Revenue', field: 'revenue', width: 150 },
+ { title: 'Cost', field: 'cost', width: 150 }
+ ]
+ }
+];
+
+const option = {
+ records,
+ columns,
+ headerHierarchyType: 'grid-tree', // Enable tree-style collapsing
+ headerExpandLevel: 2, // Expand to the second level by default
+ widthMode: 'standard',
+ defaultRowHeight: 40
+};
+
+const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
+window.tableInstance = tableInstance;
+```
+
+---
+
+## Advanced Configuration
+
+### Listen to Collapse Events
+
+Capture user interactions and execute custom logic:
+
+```javascript
+tableInstance.on(VTable.ListTable.EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, args => {
+ if (args.cellLocation === 'columnHeader') {
+ console.log('Header state changed:', args);
+ }
+});
+```
+
+### Dynamically Update Header States
+
+Programmatically control header expansion/collapse:
+
+```javascript
+// Toggle the expansion state of a specific column
+tableInstance.toggleHierarchyState(col, row);
+```
+
+---
+
+With these configurations, you can quickly implement structured multi-level headers with dynamic interactions, ideal for complex data analysis scenarios.
diff --git a/docs/assets/guide/menu.json b/docs/assets/guide/menu.json
index c4e7535d66..0577c37e5d 100644
--- a/docs/assets/guide/menu.json
+++ b/docs/assets/guide/menu.json
@@ -87,6 +87,13 @@
"en": "tree list"
}
},
+ {
+ "path": "columns_tree",
+ "title": {
+ "zh": "表头分组及折叠",
+ "en": "Columns tree"
+ }
+ },
{
"path": "group_list",
"title": {
diff --git a/docs/assets/guide/zh/Event/event_list.md b/docs/assets/guide/zh/Event/event_list.md
index a31f2ed4f1..9927d0a0e9 100644
--- a/docs/assets/guide/zh/Event/event_list.md
+++ b/docs/assets/guide/zh/Event/event_list.md
@@ -35,7 +35,7 @@
| 滚动 | SCROLL | 滚动表格事件 |
| 滚动 | SCROLL_HORIZONTAL_END | 横向滚动右侧事件 |
| 滚动 | SCROLL_VERTICAL_END | 竖向滚动底部事件 |
-| 点击下拉图标 | DROPDOWNMENU_CLICK | 点击下拉菜单图标事件 |
+| 点击下拉图标 | DROPDOWN_MENU_CLICK | 点击下拉菜单图标事件 |
| 点击下拉菜单 | MENU_CLICK | 点击下拉菜单事件 |
| 鼠标经过迷你图 | MOUSEOVER_CHART_SYMBOL | 鼠标经过迷你图标记事件 |
| 拖拽框选鼠标松开 | DRAG_SELECT_END | 拖拽框选单元格鼠标松开事件 |
diff --git a/docs/assets/guide/zh/gantt/introduction.md b/docs/assets/guide/zh/gantt/introduction.md
index 521f6ea387..6f1555c939 100644
--- a/docs/assets/guide/zh/gantt/introduction.md
+++ b/docs/assets/guide/zh/gantt/introduction.md
@@ -156,11 +156,6 @@ links:[
按钮的样式可以通过`taskBar.scheduleCreation.buttonStyle`配置。
如果当前配置不能满足需求,也可以通过`taskBar.scheduleCreation.customLayout`配置项自定义创建排期的展示效果。
-**注意:不同的甘特图实例,创建排期能力不同。:**
-
-当`tasksShowMode`为`TasksShowMode.Tasks_Separate`或`TasksShowMode.Sub_Tasks_Separate`,也就是每条数据有对应的一行位置展示,但是数据中没有设置 startDate 和 endDate 的字段时,鼠标 hover 到该行会出现创建按钮,点击按钮会创建排期并展示任务条。
-
-当`tasksShowMode`为`TasksShowMode.Sub_Tasks_Inline`或`TasksShowMode.Sub_Tasks_Arrange`或`TasksShowMode.Sub_Tasks_Compact`,需要明确指明 scheduleCreatable 为`true`,才可出现创建按钮。当鼠标 hover 到空白区域即会显示创建按钮,点击按钮会触发事件`GANTT_EVENT_TYPE.CREATE_TASK_SCHEDULE`但不会真正的创建任务排期,使用者需要监听该事件根据业务需求来自行创建排期更新数据。
**注意:不同的甘特图实例,创建排期能力不同。:**
diff --git a/docs/assets/guide/zh/table_type/List_table/columns_tree.md b/docs/assets/guide/zh/table_type/List_table/columns_tree.md
new file mode 100644
index 0000000000..5f32092b7e
--- /dev/null
+++ b/docs/assets/guide/zh/table_type/List_table/columns_tree.md
@@ -0,0 +1,108 @@
+## 基本表格表头分组及折叠
+
+在本教程中,我们将学习如何使用 VTable 实现多层表头分组及折叠功能,通过树形结构展示复杂表头层级。
+
+## 使用场景
+
+表头分组及折叠功能适用于以下场景:
+
+- **多维数据分析**:需要将多个关联字段合并为逻辑分组(如“销售数据”包含“销售额”“利润”等子列)。
+- **复杂数据结构**:数据表字段具有明确的层级关系(如“地区-省份-城市”三级结构)。
+- **空间优化**:通过折叠功能隐藏非关键列,提升表格可读性。
+- **动态交互**:允许用户按需展开/收起特定分组,灵活查看数据。
+
+## 使用方式
+
+### 1. 配置多层表头结构
+
+在 `columns` 配置中使用嵌套结构定义表头层级。每个分组通过 `columns` 字段添加子列,形成树形关系。
+
+### 2. 启用树形折叠功能
+
+设置 `headerHierarchyType: 'grid-tree'` 开启表头树形折叠交互。
+
+### 3. 设置默认展开层级
+
+通过 `headerExpandLevel` 指定初始展开层级(默认值为 `1`,即仅展示第一级分组)。
+
+## 示例
+
+```javascript livedemo template=vtable
+const records = [
+ { region: 'North', province: 'A', city: 'City1', revenue: 1000, cost: 600 },
+ { region: 'North', province: 'A', city: 'City2', revenue: 1500, cost: 800 },
+ { region: 'South', province: 'B', city: 'City3', revenue: 2000, cost: 1100 }
+];
+
+const columns = [
+ {
+ title: 'Region',
+ field: 'region',
+ width: 150,
+ columns: [
+ {
+ title: 'Province',
+ field: 'province',
+ width: 150,
+ columns: [
+ {
+ title: 'City',
+ field: 'city',
+ width: 150
+ }
+ ]
+ }
+ ]
+ },
+ {
+ title: 'Financial Metrics',
+ field: 'metrics',
+ width: 180,
+ columns: [
+ { title: 'Revenue', field: 'revenue', width: 150 },
+ { title: 'Cost', field: 'cost', width: 150 }
+ ]
+ }
+];
+
+const option = {
+ records,
+ columns,
+ headerHierarchyType: 'grid-tree', // 启用树形折叠
+ headerExpandLevel: 2, // 默认展开至第二级
+ widthMode: 'standard',
+ defaultRowHeight: 40
+};
+
+const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
+window.tableInstance = tableInstance;
+```
+
+---
+
+## 高级配置
+
+### 监听折叠事件
+
+获取用户交互行为并执行自定义逻辑:
+
+```javascript
+tableInstance.on(VTable.ListTable.EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, args => {
+ if (args.cellLocation === 'columnHeader') {
+ console.log('表头状态变化:', args);
+ }
+});
+```
+
+### 动态更新表头状态
+
+手动控制表头展开/收起:
+
+```javascript
+// 切换指定列的展开状态
+tableInstance.toggleHierarchyState(col, row);
+```
+
+---
+
+通过上述配置,可快速实现多层表头的结构化展示与动态交互,适用于复杂数据场景下的灵活分析需求。
diff --git a/docs/assets/option/en/common/option-secondary.md b/docs/assets/option/en/common/option-secondary.md
index 894a21bff9..0b91964b75 100644
--- a/docs/assets/option/en/common/option-secondary.md
+++ b/docs/assets/option/en/common/option-secondary.md
@@ -194,7 +194,6 @@ Align excel advanced capabilities
Fill handle, when set to true, when a cell is selected, the fill handle will be displayed on the lower right side of the cell. You can drag the fill handle to edit the value of the cell. Or double-click the fill handle to change the value of the cell you want to edit.
-
#${prefix} hover(Object)
Hover interaction configuration, specific configuration items as follows:
@@ -231,6 +230,20 @@ Possible values:
'body': Do not select the table header. Clicking a row header selects all body cells in the row. Clicking a column header selects all body cells in the column.
+##${prefix} cornerHeaderSelectMode ('inline' | 'cell' | 'body' | 'all') = 'all'
+
+When clicking on the corner header cell, the selection mode to be applied.
+
+Possible values:
+
+'inline': Clicking the corner header selects the entire column;
+
+'cell': Select only the currently clicked corner header cell;
+
+'body': Clicking the corner header selects all body cells;
+
+'all': Clicking the corner header selects the entire table.
+
##${prefix} disableSelect (boolean | ((col: number, row: number, table: BaseTableAPI) => boolean)) = false
Do not respond to mouse select interaction.
@@ -653,4 +666,4 @@ Validate when the drag to move position ends.
```
validateDragOrderOnEnd?: (source: CellAddress, target: CellAddress) => boolean;
-```
\ No newline at end of file
+```
diff --git a/docs/assets/option/en/table/listTable.md b/docs/assets/option/en/table/listTable.md
index 50c73f0741..3ff595bb3d 100644
--- a/docs/assets/option/en/table/listTable.md
+++ b/docs/assets/option/en/table/listTable.md
@@ -93,6 +93,13 @@ When displayed as a tree structure, the number of levels is expanded by default.
Whether nodes at the same level are aligned by text, such as nodes without collapsed expansion icons and nodes with icons. Default is false
+## headerHierarchyType('grid-tree')
+
+Defines the hierarchy display mode for headers. When set to 'grid-tree', it enables tree-style expand/collapse functionality in the header structure.
+
+## headerExpandLevel(number)
+
+Sets the initial expansion level of headers. Defaults to 1.
## aggregation(Aggregation|CustomAggregation|Array|Function)
diff --git a/docs/assets/option/zh/common/option-secondary.md b/docs/assets/option/zh/common/option-secondary.md
index b0cef896ce..9290e53fb5 100644
--- a/docs/assets/option/zh/common/option-secondary.md
+++ b/docs/assets/option/zh/common/option-secondary.md
@@ -192,8 +192,6 @@ export interface SelectAllOnCtrlAOption {
填充柄,设置为 true 后,当选中单元格后,填充柄会显示在单元格右下方,可以拖动填充柄来编辑单元格的值。或者双击填充柄来改变需要编辑单元格的值。
-
-
#${prefix} hover(Object)
hover 交互配置,具体配置项如下:
@@ -227,6 +225,20 @@ hover 交互响应模式:十字交叉、整列、整行或者单个单元格
'body': 不选择表头,点击行表头则选择该行所有 body 单元格,点击列表头则选择该列所有 body 单元格。
+##${prefix} cornerHeaderSelectMode ('inline' | 'cell' | 'body' | 'all') = 'all'
+
+点击角头 corner 单元格时的选中方式。
+
+可选值:
+
+'inline': 点击 corner 角头整列选中;
+
+'cell': 仅仅选择当前点击的 corner 角头单元格;
+
+'body': 点击 corner 角头,选择所有 body 单元格;
+
+'all': 点击 corner 角头,选中整个图表。
+
##${prefix} disableSelect (boolean | ((col: number, row: number, table: BaseTableAPI) => boolean)) = false
不响应鼠标 select 交互。
@@ -638,7 +650,7 @@ animationAppear?: boolean | {
##${prefix} frozenColDragHeaderMode(string) = 'fixedFrozenCount'
-拖拽表头移动位置 针对冻结部分的规则 默认为 fixedFrozenCount。基本表格ListTable类型设置才有效!
+拖拽表头移动位置 针对冻结部分的规则 默认为 fixedFrozenCount。基本表格 ListTable 类型设置才有效!
- "disabled"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。
- "adjustFrozenCount"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。
@@ -651,6 +663,3 @@ animationAppear?: boolean | {
```
validateDragOrderOnEnd?: (source: CellAddress, target: CellAddress) => boolean;
```
-
-
-
diff --git a/docs/assets/option/zh/table/listTable.md b/docs/assets/option/zh/table/listTable.md
index 46912dd2f7..42b7aa478b 100644
--- a/docs/assets/option/zh/table/listTable.md
+++ b/docs/assets/option/zh/table/listTable.md
@@ -90,6 +90,13 @@ SortState {
同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认 false
+## headerHierarchyType('grid-tree')
+
+表头中层级维度结构显示形式,设置为 'grid-tree' 时开启树形结构的展开折叠功能。
+
+## headerExpandLevel(number)
+
+表头初始化展开层数,默认是 1。
## aggregation(Aggregation|CustomAggregation|Array|Function)
diff --git a/packages/react-vtable/demo/src/App.tsx b/packages/react-vtable/demo/src/App.tsx
index 245516aea8..0e34141142 100644
--- a/packages/react-vtable/demo/src/App.tsx
+++ b/packages/react-vtable/demo/src/App.tsx
@@ -23,6 +23,8 @@ import customLayoutDomSite from './component/custom-layout-dom-site';
import customLayoutDomSite1 from './component/custom-layout-dom-site-1';
import customLayoutPivot from './component/custom-layout-pivot';
+import userCustomLayoutUpdate from './component/user/custom-layout-update';
+
// export default listTable;
// export default listEditor;
// export default listOptionRecord;
@@ -45,5 +47,7 @@ import customLayoutPivot from './component/custom-layout-pivot';
// export default customLayout;
// export default customLayoutDom;
// export default customLayoutDomSite;
-export default customLayoutDomSite1;
+// export default customLayoutDomSite1;
// export default customLayoutPivot;
+
+export default userCustomLayoutUpdate;
diff --git a/packages/react-vtable/demo/src/component/user/custom-layout-update.tsx b/packages/react-vtable/demo/src/component/user/custom-layout-update.tsx
new file mode 100644
index 0000000000..e4b6eed6df
--- /dev/null
+++ b/packages/react-vtable/demo/src/component/user/custom-layout-update.tsx
@@ -0,0 +1,188 @@
+/* eslint-disable max-len */
+import { useEffect, useRef, useState } from 'react';
+import ReactDOM from 'react-dom/client';
+import type { CustomLayoutFunctionArg } from '../../../../src';
+import {
+ ListTable,
+ ListColumn,
+ CustomLayout,
+ Group,
+ Text,
+ Tag,
+ Checkbox,
+ Radio,
+ Button,
+ Link,
+ Avatar,
+ Image,
+ Popover
+} from '../../../../src';
+
+const UserProfileComponent = (props: any) => {
+ const { table, row, col, rect, dataValue, align } = props;
+ if (!table || row === undefined || col === undefined) {
+ return null;
+ }
+ const { height, width } = rect || table.getCellRect(col, row);
+ const record = table.getRecordByCell(col, row);
+
+ const [hover, setHover] = useState(false);
+
+ return (
+