Our flexible Kanban board for managing tasks with drag drop


Post by jasonlunsford »

Dear Support,

Simple issue, hopefully a simple fix. When I attach a handler to:

onBeforeTaskEdit

The data payload returned for the currently edited card is setting the "startDate" to undefined. We are FEEDING each card with a value called "startDate" from the API - and that value is a timestamp in epoch format. I know each card gets a "startDate" from our data set - and I've established TaskBoard is definitely setting the value to undefined. The property lives here:

  const onBeforeTaskEdit = (payload) => {
    onEdit(payload);
    console.log(payload.taskStore.data.startDate); // <-- is returning UNDEFINED, but should be a value
    return false; // <-- return false to suppress default modal
  };

Any thoughts on this?


Post by marcio »

Hey Jason,

Where are you getting this taskStore property? I'm checking the documentation here https://bryntum.com/products/taskboard/docs/api/TaskBoard/feature/TaskEdit#event-beforeTaskEdit and that's not a valid property, can you share a sample project with your configuration?

Attachments
Screenshot 2023-09-11 at 17.08.21.png
Screenshot 2023-09-11 at 17.08.21.png (59.91 KiB) Viewed 704 times

Best regards,
Márcio


Post by jasonlunsford »

Hi Marcio,

Sorry, that was a typo on my part. Here is my implementation code:

return (
      <BryntumProjectModel
        ref={projectRef}
        events={taskData}
        taskModelClass={DeliverableTask}
        onChange={onModelChange}
      />
      <BryntumTaskBoard
        height={'100%'}
        ref={boardRef}
        taskRenderer={taskRenderer}
        project={projectRef}
        onBeforeTaskEdit={onBeforeTaskEdit}
        {...taskBoardConfig}
      />
);

The method I have assigned to the property of the same name "onBeforeTaskEdit":

  const onBeforeTaskEdit = (payload) => {
    onEdit(payload);

console.log(payload.taskRecord.data.startDate); // <-- is returning UNDEFINED, but should be a value
return false;
  };

Please note if I grab the payload that I get as an argument to the onChange method of the "BryntumProjectModel" component, that payload has an "originalData" object - within THAT object is a startDate ... with my data! So obviously something is happening internally that is setting my data to "undefined".


Post by marcio »

Hey Jason,

Thanks for the clarification.

Can you share what DeliverableTask looks like? If you could assemble a sample project, with those snippets that you shared plus a sample of data, that would speed up a lot of our work here. But a sample of data would be really nice for us to use here with a test case.

Best regards,
Márcio


Post Reply