ag-grid 拖动子列时如何拖动整个父列
ag-grid How to drag whole parent column when dragging child column
我有一个类似这样的网格:
ag-grid 默认允许您将单个子列(如 'Game Name' 或 'Bought')从父列中拖出,将父列一分为二。我想要做的是禁用此行为,这样当您尝试像 'Bought' 那样拖动子列时,它会改为拖动整个 'Game of Choice' 列及其两个子列。
如果这不可行,是否有一种方法可以禁用仅拖动子项但继续启用拖动父项的功能?
你看起来像下面这样。
https://www.ag-grid.com/javascript-grid-grouping-headers/#grouping-example-with-marrychildren-set
Marry Children
Sometimes you want columns of the group to always stick together. To achieve this, set the column group property marryChildren=true. The
example below demonstrates the following:
Both 'Athlete Details' and 'Sports Results' have marryChildren=true.
If you move columns inside these groups, you will not be able to move the column out of the group. For example, if you drag
'Athlete', it is not possible to drag it out of the 'Athlete
Details' group.
If you move a non group column, eg 'Extra 3', it will not be possible to place it in the middle of a group and hence impossible
to break the group apart.
It is possible to place a column between groups (eg you can place 'Extra 3' between the 'Athlete Details' and 'Sports Results').
我有一个类似这样的网格:
ag-grid 默认允许您将单个子列(如 'Game Name' 或 'Bought')从父列中拖出,将父列一分为二。我想要做的是禁用此行为,这样当您尝试像 'Bought' 那样拖动子列时,它会改为拖动整个 'Game of Choice' 列及其两个子列。
如果这不可行,是否有一种方法可以禁用仅拖动子项但继续启用拖动父项的功能?
你看起来像下面这样。
https://www.ag-grid.com/javascript-grid-grouping-headers/#grouping-example-with-marrychildren-set
Marry Children
Sometimes you want columns of the group to always stick together. To achieve this, set the column group property marryChildren=true. The example below demonstrates the following:
Both 'Athlete Details' and 'Sports Results' have marryChildren=true.
If you move columns inside these groups, you will not be able to move the column out of the group. For example, if you drag 'Athlete', it is not possible to drag it out of the 'Athlete Details' group.
If you move a non group column, eg 'Extra 3', it will not be possible to place it in the middle of a group and hence impossible to break the group apart.
It is possible to place a column between groups (eg you can place 'Extra 3' between the 'Athlete Details' and 'Sports Results').