Hi!
I've tried to create a custom sidepanel. It sometimes works, but not always.
It looks as if
is not always defined when loading the panel. Is there a way to wait for it?
I've tried to create a custom sidepanel. It sometimes works, but not always.
It looks as if
Code:
this.model.get('cOffeneKursgeb')
Code:
define(['views/record/panels/side'], (SidePanelView) => {
return class extends SidePanelView
{
templateContent = ''
setup() {
super.setup();
// Trigger fetching the data
this.model.fetch();
const offen = this.model.get('cOffeneKursgeb'); // Access after data has loaded
console.log(offen);
if (offen === 0 || offen === null)
{
this.templateContent = "";
}
else
{
console.log("set");
this.templateContent =
"<div style='color: var(--link-color); font-size: 2rem;font-weight: 500; padding-top: 5px;'>" +
"€" + offen + ",00</div>";
}
}
}
});

Comment