How do I change the connector url for mobile scheduler

I want to be able to change the connector url after the user has logged in.
I have

dhx.ui({
	view: "scheduler",
	id: "scheduler",
	save: "data/bookings_mobile.php?user="+user+"&user_type="+userType
});

Initially, the variables user and userType are blank, but after the user has logged in, the values are set. I then do

$$("scheduler").clearAll();			
$$("scheduler").load("data/bookings_mobile.php?user="+user+"&user_type="+userType,"scheduler");
$$("scheduler").config.save = "data/bookings_mobile.php?user="+user+"&user_type="+userType;			
var dp = new dhx.DataProcessor({
	master:$$('scheduler')
});

The load works perfectly, but the Save doesn’t work as the user and userType variables are still blank, so the request fails.
Perhaps I don’t have the configuration correct for $$(“scheduler”).config.save?
Any help appreciated. Thanks :slight_smile:

Hello,

save is applied only when scheduler is initialized. You should redefine “url” property of the DataProcessor:

dhx.dp($$(“scheduler”)).config.url = “data/bookings_mobile.php?user=”+user+"&user_type="+userType;

Thanks very much Alexandra. That works perfectly :smiley: