Premium support for our pure JavaScript UI components


Post by dphilip »

UseCase:

  • On performing unassign action on an event, change the value of property <X> for the event to false (if <X> has been set to true before)
  • On performing redo action, the event should be reassigned to the timeline and change the property <X> back to true (if <X> value was changed during the previous unassign)

P.S. These 2 actions (unassign and setting property <X>) should be a single transaction in undo/redo.

Is there a nice way to implement this?


Post by alex.l »

All the best,
Alex


Post by dphilip »

  1. Is there an example that I can take inspiration from?

  2. Unassign seems to be done internally in Bryntum code. How do we manipulate this action?


Post by alex.l »

We need exact case to help you here.
NO way to manipulate with internal actions. But you also updated "X" property, you able to catch the moment of change.
In 2 words, you need to disable autoRecord, start transaction before all changes, do required changes and stop transaction after all changes done.
The code for inspiration is below. Not sure what product are we talking about, so it's for the SchedulerPro

schedulerPro.project.stm.startTransaction();
schedulerPro.eventStore.first.name = 'new name';
schedulerPro.eventStore.first.assign(resourceRecord);
schedulerPro.project.stm.stopTransaction();

All the best,
Alex


Post Reply