Our state of the art Gantt chart
Hi, I get this warning in console :
CheckColumn is configured with a field, but this is not part of your Model fields
collection.
Here is the definition of the column :
private buildFreeHourColumn(): any {
return {
id: GanttColumns.COLUMN_FREE_HOUR,
field: 'freeHour',
type: 'check',
text: 'Heure libre'
};
}
And here is the definition of custom TaskModel :
export default class BeoTaskModel extends TaskModel {
static get fields() {
return [
{ name: 'freeHour', type: 'boolean' }
];
}
}
What should I do to make this warning disappear ?
Yes I have added the taskModelClass already.
We have other columns with custom fields, but the warning is displayed only for the 3 CheckColumns.
Then this shouldn't be the case. I have tried this in our online example using the below code here https://bryntum.com/products/gantt/examples/basic/:
import { Gantt, StringHelper, TaskModel } from '../../build/gantt.module.js?479837';
import shared from '../_shared/shared.module.js?479837';
class BeoTaskModel extends TaskModel {
static get fields() {
return [
{ name: 'freeHour', type: 'boolean' }
];
}
}
new Gantt({
appendTo : 'container',
dependencyIdField : 'sequenceNumber',
rowHeight : 45,
tickSize : 45,
barMargin : 8,
project : {
taskModelClass : BeoTaskModel,
autoSetConstraints : true, // automatically introduce `startnoearlier` constraint if tasks do not use constraints, dependencies, or manuallyScheduled
autoLoad : true,
transport : {
load : {
url : '../_datasets/launch-saas.json'
}
}
},
columns : [
{
field: 'freeHour',
type: 'check',
text: 'Heure libre'
},
{ type : 'name', width : 250 }
],
// Custom task content, display task name on child tasks
taskRenderer({ taskRecord }) {
if (taskRecord.isLeaf && !taskRecord.isMilestone) {
return StringHelper.encodeHtml(taskRecord.name);
}
}
});
I will have to take a look at your code. Can you please share a simple runnable test case with us so we can debug it and see what is the problem?
Hi, I just tested on your example and I can see the warning in the logs (cf screenshot).
- checkcolumn.PNG (134.29 KiB) Viewed 82 times
Hello,
Declaring the TaskModel class not gonna do anything unless you set it on the project config. See the below clip and screenshot:
- Screenshot 2024-10-11 at 1.29.08 AM.png (513.89 KiB) Viewed 66 times
Hello, you are right. Sorry I forgot this little piece of code.