bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

Mapping data fields for `ProjectModel` is not working #9796

Closed chuckn0rris closed 3 months ago

chuckn0rris commented 3 months ago

Forum post

Hello,

How can I map project fields to custom fields? My backend API returns fields in snake_case format, but the library by default expects camelCase. I tried extending the ProjectModel class as follows, but it doesn't seem to be working:

import { ProjectModel } from "@bryntum/gantt";

export default class MyProjectModel extends ProjectModel {
  static get fields() {
    return [
      {
        name: "startDate",
        dataSource: "start_date",
      },
    ];
  }
}

Thanks in advance!