Our flexible Kanban board for managing tasks with drag drop


Post by yingtao »

I see docs has "onAlignTargetOutOfView" api,
https://www.bryntum.com/docs/taskboard/api/Core/widget/Widget#function-onAlignTargetOutOfView
It's internal,can I use it?how to use it?


Post by alex.l »

Hi yingtao,

No, we do not recommend to use private methods/properties because it may be changed/renamed without notification in upgrade guides.

What do you want to achieve? What is your goal?

All the best,
Alex


Post by yingtao »

I want achieve when task show in visible range,I prepare use IntersectionObserver to try,Have any life cycle to to get task element?I need use it to observe.


Post by marcio »

Hey yingtao,

You can try to add the IntersectionObserver when the task is rendered. Like this

listeners : {
        renderTask : ({ element, taskRecord }) => {
            const callback = (entries) => {
                const [entry] = entries;
                console.log('taskRecord', taskRecord);
                console.log('entry', entry);
            };
            
const options = { root : null, rootMargin : '0px', threshold : 0.1 }; const observer = new IntersectionObserver(callback, options); observer.observe(element); } }

https://www.bryntum.com/docs/taskboard/api/Core/mixin/Events#config-listeners
https://www.bryntum.com/docs/taskboard/api/TaskBoard/view/mixin/TaskBoardDomEvents#event-renderTask

Best regards,
Márcio


Post by yingtao »

Thank you for you answer。Have you any suggestion about avoid re-render?such as when I click taskMenu or click task。I don‘t want task re-render.


Post by marcio »

I'm afraid is not possible because it's how the renderTask works, as it says in the documentation

This happens on initial render, when a task is added or when the task element is updated.

Perhaps you could use the isRefresh parameter to only add the IntersectionObserver when the variable is false (it means that the task was added).

Best regards,
Márcio


Post Reply