When the board change event is raised, is it possible to get the order (or index) of the moved item in the event data.
I am getting this manually like this:
I was just wondering if there is something built in that I have missed, if not, this would ideally be included in the event item data for the moved item in order to persist the item orders when saved, it seems like a natural property to have.
Thanks.
note: there is no TaskBoard tag to assign this to.
I am getting this manually like this:
const handleTaskBoardChange = React.useCallback((event) => {
if (event.type === "task") {
setTaskData(event.data);
// Get new order of moved item
var allItemsAtDroppedStatus = event.data.filter(x => { return x.status === event.item.status });
var newOrder = allItemsAtDroppedStatus.findIndex(x => { return x.id === event.item.id }) + 1;
var data = { id: event.item.id, previousCampaignProjectStageType: event.previousItem.status, newCampaignProjectStageType: event.item.status, order: newOrder, };
updateCampaignTaskBoardStage(data)
.then((response) => {
loadTaskBoardData();
})
.catch((response) => {
});
}
}, []);
I was just wondering if there is something built in that I have missed, if not, this would ideally be included in the event item data for the moved item in order to persist the item orders when saved, it seems like a natural property to have.
Thanks.
note: there is no TaskBoard tag to assign this to.