Angular ngx-datatable multiple data in one column

前端 未结 2 2055
日久生厌
日久生厌 2021-01-12 11:56

I\'ve got a little problem adding more then one prop to column in ngx-datatable:

columns = [
  { prop: \'semesterName\', name: \'סמסטר\', resizeable: false }         


        
2条回答
  •  醉梦人生
    2021-01-12 12:49

    If you want to stick to the usage of columns and rows inputs, you can add the aggregated column to the rows themselves. Without mutating courses, the properties would look something like this:

    const rows = courses.map(course => ({
      ...course,
      eventDetails: `${course.eventName} on ${course.when}`
    }))
    
    const columns = [
      { prop: 'eventDetails', name: 'Event', resizable: false },
      // the rest of your columns...
    ]
    

提交回复
热议问题