Team,
I want to post the change user makes on the scheduler on click of a button using crudmanager.
Basically I dont want to set autoSync to true.
How may I send the changes to server without using autosync feature?
Please try looking in our docs / guides first: It's easy to find usually. https://bryntum.com/docs/scheduler/#Scheduler/crud/AbstractCrudManagerMixin#function-sync
You should know better as it depends on the application. Both approaches have pros and cons. Syncing on button click would allow you to benefit from undo/redo feature as you can see in this demo: https://www.bryntum.com/examples/scheduler/undoredo/
Maxim,
I am posting changes on button click using below code, Do i need to make any changes in crudManager block as well to re render the saved changes?
Below is the save button call to post changes
save() {
this.scheduler.schedulerEngine.crudManager.sync().then(
() => console.log("Changes posted..."),
({ response, cancelled }) => console.log(`Error: Saving changes failed`)
);
}
CrudManager block :-
crudManager = {
listeners: {
load({ response }) {
console.log(response);
const
start = new Date(response.calendar.startDate),
end = new Date(response.calendar.endDate)
// childid = response.details.childId
// parentid = response.details.parentId
// console.log(childid),
// console.log(parentid),
this.scheduler.setTimeSpan(start, end);
},
beforeResponseApply: ({ response }) => {
response.resources.rows = response.resources.vehicles;
response.events.rows = response.events.tests;
}
},
autoLoad: true,
autoSync: false,
transport: {
load: {
url: './api/data/get'
},
sync: {
url: './api/data/save',
},
}
}
mats, Need your expertise to understand a scenario.
User clicks a save button to post the changes and eventually sync method gets called.
Will both/all changes get posted at once or after making each individual change user should hit the save button to call sync operation?