AngularMaterialDragDrop在具有可展开行的表格中失去了所有行拖动时的可展开同步。
创始人
2024-10-28 09:01:37
0

这是一个Angular Material DragDrop问题,当将行拖到其他行上时,对于具有可展开子行的行,该子行将失去展开的状态。解决此问题的方法是将dragContainerData传递给drop方法,并更新拖动和放置之后的行数据。下面是示例代码:

HTML模板:

Name Age Actions
{{row.name}} {{row.age}}
Hello {{row.name}}!

TS文件:

import { Component } from '@angular/core';
import { CdkDragDrop, CdkDragRelease, moveItemInArray } from '@angular/cdk/drag-drop';

@Component({
  selector: 'app-dragdrop-table',
  templateUrl: './dragdrop-table.component.html',
  styleUrls: ['./dragdrop-table.component.css'],
})
export class DragdropTableComponent {
  rows = [
    { name: 'Alice', age: 20, expanded: false },
    { name: 'Bob', age: 20, expanded: false },
    { name: 'Carol', age: 20, expanded: false },
  ];

  onDrop(event: CdkDragDrop) {

相关内容

热门资讯

透视智能ai!hhpoker透... 透视智能ai!hhpoker透视脚本(透视)详细辅助详细教程(其实有挂)1、透视智能ai!hhpok...
透视有挂!aapoker透视插... 1、透视有挂!aapoker透视插件(透视)往昔真的是有挂(详细辅助2025新版教程);详细教程。2...
透视软件(WePoKer)aa... 透视软件(WePoKer)aa扑克网上的挂真的(透视)详细辅助必赢教程;亲真的是有正版授权,小编(透...
透视总结!德普之星透视辅助插件... 透视总结!德普之星透视辅助插件(透视)详细辅助微扑克教程(本来是真的有挂)小薇(透视辅助)致您一封信...
透视美元局!德州局透视脚本免费... 此外,数据分析德州(德州局透视脚本免费版下载手机版)辅助神器app还具备辅助透视行为开挂功能,通过对...
透视总结(WePoKer)微扑... 透视总结(WePoKer)微扑克有没有辅助挂(透视)详细辅助新2025教程;微扑克有没有辅助挂软件透...
透视讲解!智星德州菠萝插件官网... 透视讲解!智星德州菠萝插件官网(透视)详细辅助2025新版(本来有挂);暗藏猫腻,小编详细说明智星德...
透视科技(wePoke)wep... 透视科技(wePoke)wepoke ai代打辅助(透视)详细辅助透明挂教程;小薇(透视辅助)致您一...
透视透视!wejoker辅助脚... 透视透视!wejoker辅助脚本(透视)真是是有挂(详细辅助可靠技巧),支持语音通讯、好友开房及战队...
透视好牌!wepoker透视脚... 透视好牌!wepoker透视脚本免费(透视)详细辅助安装教程(一贯是有挂);1、用户打开应用后不用登...