Ngx-datatable - 创建马赛克

时间:2021-01-21 14:29:11

标签: angular ngx-datatable

我在我的项目中使用了 ngx-datatable,我需要创建一个相机马赛克,但我需要将列和行分开。

例如:

我的数据

    [
      {
        name: "Pet shop",
        id: "1",
        video: 'https://'
      },
      {
        name: "E-shop",
        id: "2",
        video: 'https://'
      },
      {
        name: "My house",
        id: "3",
        url: 'https://'
      },
      {
        name: "Garage",
        id: "4",
        url: 'https://'
      },
    ]

我需要什么

enter image description here

我也需要分页。


我尝试向对象添加动态属性以适合列


 columnns = [
  { prop: 'column1', name: 'column1' },
  { prop: 'column2', name: 'column2' }
 ]

 myData = [
  {
    name: "Pet shop",
    id: "1",
    video: 'https://',
    column1: 'column1'
  },
  {
    name: "E-shop",
    id: "2",
    video: 'https://',
    column2: 'column2'
   }
 ]

我也尝试将两个对象合二为一

 columnns = [
  { prop: 'column1', name: 'column1' },
  { prop: 'column2', name: 'column2' }
 ]

myData = [
  {
    column1: "column1",
    camera1: {
      name: "Pet shop",
      id: "5f365ab58a5da52c461c838e",
      video: 'https://',
    },
    column2: "column2",
    camera2: {
      name: "Sala de Espera",
      id: "5f4798948a5da5023294ddb7",
      video: 'https://',
    }
  }
]

0 个答案:

没有答案
相关问题