Skip to content

Instantly share code, notes, and snippets.

@xarimanx
Created May 7, 2014 11:31
Show Gist options
  • Save xarimanx/70806546d888bba3e086 to your computer and use it in GitHub Desktop.
Save xarimanx/70806546d888bba3e086 to your computer and use it in GitHub Desktop.
dhtmx scheduler init
$(document).ready(function() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.start_on_monday = false;
scheduler.config.show_loading = true;
scheduler.config.prevent_cache = true;
/*
scheduler.config.collision_limit = 1
scheduler.attachEvent("onEventCollision", function (ev, evs){
console.log(ev);
console.log(evs);
alert('Sorry you already have an event with in that timeslot');
return false;
});
*/
scheduler.templates.event_text = function(start,end,ev){
return 'Subject: ' + ev.text + '';
};
scheduler.init('scheduler',new Date(),"month");
scheduler.load("/events.json", 'json');
var dp = new dataProcessor("/events/save");
dp.init(scheduler);
dp.setTransactionMode("POST",false);
dp.attachEvent("onAfterUpdateFinish",function(){
scheduler.clearAll();
scheduler.load("/events.json", 'json');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment