Hi Team,
I try to use dhtmlxScheduler contained in a dhtmlxLayout. The layout-cell uses a toolbar where some usernames can be selected from a “buttonSelect” item. Depending on the selected username the corresponding scheduler data should be loaded from DB.
For doing this i execute the following javascript code which is called when some username was selected from toolbar and the onClick event was fired:
function loadSchedulerData(system_user_id) {
// clear all schedulder events from previous selected user
if (scheduler) scheduler.clearAll();
// load the currently selected users events
scheduler.load("/events.php?system_user_id=" + system_user_id);
// create the data processor for creating events for the currently selected user
var dp = new dataProcessor("/events.php?system_user_id=" + system_user_id);
dp.init(scheduler);
}
This works really nice so far. The problem is, that when i change the username from one to another and try to create a new event, the http post request for creating is sent twice with both user ID´s; the currently and the previously selected one (as seen in firebug). The result is, that two new event-records are created in the DB … one for each user.
I am sitting on this for hours now. Could please anybody give me some hint?
Many thanks in advance
Michael