search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Kanban - Insert new card at specific position

Asked by Wolfgang
3 months ago.

Hi Dan,

I´m getting update notifications on Kanban cards via message broker and I need to insert new cards depending on a sudden sort criteria (datetime value in my case).
Is there a way of having a card inserted at a sudden position (between existing cards, e.g.) within one column?

Thanks a lot in advance
Wolfgang

Answer posted by Dan Letecky [DayPilot]
3 months ago.

The Kanban component respects the original order of items (in cards.list). You can insert the card at the desired location there and call update().

Comment posted by Wolfgang
3 months ago.

As always: Perfect, it´s working.

One additional question: Using dp.cards.update(modifiedCard), the card does not move to another column. If I check in the browser console, it seems that the new data is not taken into account. I search the job using modifiedCard = cards.find(id), and I modify the data-object of the card object.
Then I call cards.update(modifiedCard), but it seems to ignore the new data (column for example). Am I doing something wrong?

Thank you
Wolfgang

Comment posted by Dan Letecky [DayPilot]
2 months ago.

Hi Wolfgang,

Sorry for the delay!

If you use the instance returned by the cards.find() method it should work fine:

const card = dp.cards.find(1);
card.data.text = 'New text';
dp.cards.update(card);

Please let me know if it doesn't work as expected.

New Reply
This reply is
Your name (optional):