使用 rowReorderable 时是否可以自定义剑道网格上的行拖动提示?
functionalName
),而不是所有列:import {RowReorderService} from '@progress/kendo-angular-grid';
import {ColumnList} from '@progress/kendo-angular-grid/columns/column-list';
import {Injectable, RendererFactory2} from '@angular/core';
@Injectable(
{providedIn: 'root'}
)
export class AttributesListingRowReorderService extends RowReorderService {
constructor(rendererFactory: RendererFactory2) {
super(rendererFactory.createRenderer(null, null));
}
public override getDefaultHintText(_columns: ColumnList, data: any[]): string {
const draggedDragRow = (this as any).getDragRowPerElement((this as any).dragTarget, data);
const draggedDataItem = draggedDragRow?.dataItem;
return draggedDataItem.functionalName;
}
}
export class EntityAttributesListingComponent implements OnInit, OnDestroy, AfterViewInit {
attributesListingRowReorderService = inject(AttributesListingRowReorderService);
@ViewChild(GridComponent) grid!: GridComponent;
ngAfterViewInit(): void {
this.grid.rowReorderService = this.attributesListingRowReorderService;
}
...
}
可以使用相同的方法自定义提示的其他方面。