Hi there!
I tried to use the trial version of TaskBoard v.4.3.8 in Salesforce LWC. However, I see an undefined error on the script loading in the Promise. It even does not reach the TaskBoard initialization function (createKanban()), but the JS module is loaded in the browser.
import {api, LightningElement} from 'lwc';
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { loadScript, loadStyle } from 'lightning/platformResourceLoader';
import TASK_BOARD from '@salesforce/resourceUrl/BryntumTaskBoard';
export default class Kanban extends LightningElement {
@api project;
_bryntumInitialized = false;
renderedCallback() {
if (this._bryntumInitialized) {
return;
}
this._bryntumInitialized = true;
Promise.all([
loadScript(this, TASK_BOARD + "/taskboard.lwc.module.js"),
loadStyle(this, TASK_BOARD + "/taskboard.stockholm.css")
])
.then(() => {
this.createKanban();
})
.catch(error => {
this.dispatchEvent(
new ShowToastEvent({
title: "Error loading Bryntum TaskBoard",
message: error,
variant: "error"
})
);
});
}
createKanban() {
const kanban = new TaskBoard({
appendTo: this.template.querySelector(".kanban-container"),
columnField : 'status',
columns : [
'todo',
'doing',
'done'
],
project : {
tasksData : [
{ id : 1, name : 'Basic task', status : 'doing' },
{ id : 2, name : 'Advanced task', status : 'todo' }
]
}
});
}
}
Am I doing something wrong, or LWC is not supported yet?