首页 > 解决方案 > ag-grid:使整行成为行拖动的夹点

问题描述

我正在使用 Vue 版本的 ag-grid 21.2.1 ( https://www.ag-grid.com/vue-getting-started/ ) 并实现了行拖动 ( https://www.ag-grid.com/ javascript-grid-row-dragging/ ) 在我们的一张桌子上。一切似乎都很好,但现在我想让整行成为拖动的“抓地力”。我尝试使用pointer-events: noneon.ag-row并使本机 ag 握把项目更大且可点击,但这似乎不起作用:

.ag-icon-grip {
    position: absolute;
    width: 600px;
    pointer-events: auto;
}

有人在这方面取得了成功吗?

标签: javascriptcssvue.jsag-grid

解决方案


可能还有其他方法,javascript但您可以使用css以下方法

css

.drag-row {
    overflow: unset !important;
}
.drag-row .ag-cell-value {
    padding-left: 24px;
}
.drag-row .ag-row-drag {
    position: absolute;
    width: 1200px;
    z-index: 2;
}

js

this.columnDefs = [
  {
    field: "athlete",
    cellClass: 'drag-row',
    rowDrag: true
  },
  // ...
];

工作的 plunker https://next.plnkr.co/edit/naFYtZTBZUJJOCfB


推荐阅读