then on taskClick, can I change the desc bodyItem hidden property to false or true?
taskBoard.on({
taskClick({ source, taskRecord, event }) {
//something like this.
taskRecord.desc.hidden = false
//the following code works but it updates all cards/taskRecords. I wanted to change the property of the selected taskRecord only.
source.bodyItems.desc.hidden = false
},
});
This works because processItems runs on each render when determining which items to include in a card, and changing the value of a field on task causes a re-render.
Hi,
I have a follow up question regarding this topic.
If I wanted to control the hidden properties of all the tasks/cards without clicking any card (eg. a checkbox outside the taskboard), what is the best way to do it?
I tried the following code. It worked but the updates are reflected once I clicked on any of the card.
processItems({ bodyItems, taskRecord }) {
// hideProps is an id of example checkbox
const hideProps = document.getElementById('hideProps').checked;
// hide status bodyItem based on checkbox value
bodyItems.status.hidden = hideProps;
},
bodyItems : {
status : { type : 'text' }
},
and to trigger a re-render, you can select/deselect one task to trigger the processItems function:
// Select first record (just for example)
taskBoard.selectTask(taskBoard.project.taskStore.records[0]);
taskBoard.deselectAll();
The above code works when I click on the card.
My question is how can I access the taskRecord.showTitle from an instance of the taskBoard? I need to change the value of taskRecord.showTitle without clicking on any card. I understand taskRecord is a single record which I clicked (from above example). But is there a way to access and change the taskRecord.showTitle for all the cards/records?