I'm struggling to get the Task Board Project taskModelClass property to work. I'd like to extend the model to add field configuration and custom methods.
In this example, I am setting the property to MyCustomTaskModel but the "name" field defaultValue does not take effect. Also, the logging shows the defaultValue is an empty string. I assume MyCustomTaskModel isn't being honored with this setup.
const taskBoard = new TaskBoard({
appendTo : document.body,
project: {
taskModelClass: MyCustomTaskModel
},
// Columns to display
columns : [
'todo',
'doing',
'done'
],
// Field used to pair a task to a column
columnField : 'status'
});
makes it work correctly.
Attachments
Screenshot 2023-09-18 at 14.13.53.png (326.67 KiB) Viewed 111 times
Your suggestion works great! I did not appreciate it was a config only, thanks for pointing this out.
I have now updated the CodePen to try to use a custom project model which references the custom task model. This is how we are currently using the project/task models in our app, but the custom task model again isn't taking effect. Is there an issue with this setup?