bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

`acceptChanges` method should also clear the cells dirty state #10012

Open ghulamghousdev opened 2 months ago

ghulamghousdev commented 2 months ago

Forum post

Hi Bryntum Team,

Quick question about the dirty state on cells - we're handling saving/syncing with the server ourselves and we need a way to just mark everything as dealt with and clear the dirty state entirely. ProjectModel.acceptChanges() sounds like what we want, but just doesn't seem to do anything (I've tried this both in our app and in your examples).

The only thing that's worked for us has been calling ProjectModel.applyChangeset() with the ProjectModel.changes property as an argument, but we're running into other issues as a consequence of this and it just seems a little overcomplicated for what it's ultimately doing.

Is there anything obvious we've missed here? Cheers

ghulamghousdev commented 2 months ago

Calling acceptChanges method does not clear the dirty state of cells, because we clear it in onStoreCommit which is called on commit event. We just need to call onStoreCommit method whenever we have called acceptChanges. Maybe we can add a new event changesAccepted and bind the onStoreCommit to it as it updates the cells state only