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",
},
];
}
}
That should be working as you showed, but I tested it and found it's not working. I've opened a ticket https://github.com/bryntum/support/issues/9796
You can subscribe on ticket updates to be notified when it's done.
load/sync should simply pick up correct field mapping after setting it in ProjectModel.
As it was recently created, we'll need some debugging from our dev team to be able to provide an ETA, please watch the ticket to check when a milestone is set to it, and then you'll have an estimation of when the fix will be available.
Hi could you please share version on Bryntum lib you used? I just re-tested it in lastest release and it worked there.
You can check in our advanced demo with small changes applied