Help with backbone integration

Hello,

I’m new to the dhtmlxScheduler world and I need some help with the backbone integration through the MVC extension.

I’ve set up a REST API (PHP backend), no problem loading events using collections “fetch” method just like in the docs (http://docs.dhtmlx.com/scheduler/backbone_integration.html).
My problem is that event creation / modification / deletion on the client does not fire the corresponding request to the server.

Is there a way to automatically persist events creation / modification / deletion to the server (just like the dataProcessor does) ?
Or do I need to handle persistence by hand ?

Thank you.

Please update the mvc extension. Previous one was not really helpfull in case of data saving.

With updated one, when you are using scheduler with Backbone Collection, scheduler will not do any attempt to save data on its own. But each operation in scheduler ( creating, editin, etc. ) will trigger related actions on Backbone Collection

So you will be able to use a code like next

[code] scheduler.backbone(events);
events.fetch();

		events.on("scheduler:add scheduler:change", function(model){
			model.save();
		});
		events.on("scheduler:remove", function(model){
			model.destroy();
		});[/code]

dhtmlxscheduler_mvc.zip (977 Bytes)

Hello,

Thanks a lot Stanislav it works like a charm ! I just have one more question, is it possible to use the liveupdate extension in association with the backbone mode ? Live update seems to require dataProcessor.

Yep, the live updates will work only with dataprocessor.
As possible workaround you can call collection.fetch() each N seconds. Collection will be reloaded from server side and scheduler will show the changes.

Ok, thank you !