Our flexible Kanban board for managing tasks with drag drop


Post by licjapodaca »

Hi there, I already call the method taskRenderer to clean the value of the task name that comes from our Database like so:

Screen Shot 2021-06-17 at 2.37.33 p.m..png
Screen Shot 2021-06-17 at 2.37.33 p.m..png (319.9 KiB) Viewed 1139 times

But when I call the load() method from the Taskboard Project the first renderization doesn't work like so:

Screen Shot 2021-06-17 at 2.36.48 p.m..png
Screen Shot 2021-06-17 at 2.36.48 p.m..png (124.48 KiB) Viewed 1139 times

But when I click over a task card, it triggers something that execute the taskRenderer method now correctly like so:

Screen Shot 2021-06-17 at 2.43.39 p.m..png
Screen Shot 2021-06-17 at 2.43.39 p.m..png (120.03 KiB) Viewed 1139 times

Is there a configuration that I miss...

Regards


Post by johan.isaksson »

Hi,

A taskRenderer is for formatting the output. We strongly recommend not assigning any values to records in it since assigning triggers another render. I will clarify this in docs.

If you need to process the data arriving from your backend you should do so on an earlier stage, perhaps in a https://bryntum.com/docs/taskboard/#TaskBoard/model/ProjectModel#event-beforeLoadApply listener

Best regards,
Johan Isaksson

Post by licjapodaca »

Excellent @johan ... Thanks for your help...

Regards


Post by licjapodaca »

Hi @johan, I already use the project event "beforeloadapply" like so:

Screen Shot 2021-06-18 at 10.48.46 a.m..png
Screen Shot 2021-06-18 at 10.48.46 a.m..png (200.7 KiB) Viewed 1130 times

In the developer console I can see the data already cleaned and I already assign the cleaned data to the "event.response", but I still see the not cleaned data like so:

Screen Shot 2021-06-18 at 10.49.17 a.m..png
Screen Shot 2021-06-18 at 10.49.17 a.m..png (250.71 KiB) Viewed 1130 times

Am I doing something wrong?

Regards


Post by licjapodaca »

Hi @johan, this works for me:

Screen Shot 2021-06-18 at 11.52.33 a.m..png
Screen Shot 2021-06-18 at 11.52.33 a.m..png (453.89 KiB) Viewed 1128 times

Regards


Post by johan.isaksson »

Hi,

The https://bryntum.com/docs/taskboard/#TaskBoard/view/TaskBoard#config-processItems hooks purpose is to determine/manipulate which items (text items, image items) etc are displayed on a tasks card. It is called on each render, thus performing actions in it that triggers a new render is not recommended.

I tried changing the project config in the columns demo to this:

project : {
        transport : {
            load : {
                url : 'data/data.json'
            }
        },

    autoLoad : true,

    onBeforeLoadApply({ response }) {
        for (const data of response.tasks.rows) {
            data.name = 'Hello';
        }
    }
}

And got this result:

Screenshot 2021-06-19 at 07.28.41.png
Screenshot 2021-06-19 at 07.28.41.png (30.13 KiB) Viewed 1126 times

Seems to work as intended, give it another shot?

Best regards,
Johan Isaksson

Post by licjapodaca »

Wow, excellent @johan, it works ... thanks

Regards


Post Reply