Updating custom LightBox field client-side

I have a custom LightBox control, a readonly label showing the user who inserted/modified the event.
server side:

			var labelUser = new LightboxLabel("userLabel", "User");
			labelUser.MapTo = "userLabel";
			sched.Lightbox.Add(labelUUser);

public class LightboxLabel : DHTMLX.Scheduler.Controls.LightboxField
	{
		public LightboxLabel(string name, string text)
			: base(name)
		{
			this.Type = "label";
			this.Label = text;
		}
	}

client-side:
scheduler.form_blocks["label"] = { render: function (sns) { return "<div class=\"labelLightBox\">user</div>"; }, set_value: function (node, value, ev) { node.childNodes[0].nodeValue = ev.userLabel; }, get_value: function (node, ev) { return node.childNodes[0].nodeValue = ev.userLabel }, focus: function (node) { } };

I bind data like this:

var events = from ln in context.UsersToAgendes
			             join e in context.Events on ln.AgendaId equals e.AgendaId
			             join a in context.Agendes on e.AgendaId equals a.key
						 join users in context.aspnet_Users on e.user_id equals users.key
			             where ln.UserId == (Guid)Membership.GetUser().ProviderUserKey
			             select new EventExtended()
			             {
			                 AgendaId = e.AgendaId,
			                 caseCode = e.caseCode,
			                 color = e.color,
			                 end_date =  e.end_date,
			                 event_length = e.event_length,
			                 event_pid = e.event_pid,
			                 id = e.id,
			                 rec_type = e.rec_type,
			                 start_date = e.start_date,
			                 text = e.text,
			                 user_id = e.user_id,
					userLabel = users.label,
					nameAgenda = a.label
			             };

As you can see my user label is retrieved by another table “aspnet_Users” which is joined to the event table which contains the user_id.
To save user I do something like this:

var changedEvent = (Event)DHXEventsHelper.Bind(typeof(Event), actionValues); 
changedEvent.user_id = (Guid)Membership.GetUser().ProviderUserKey;

My problem is that client-side is not updating the label with the new user on all succeeding updates.
The event "get_value: " has always the “ev.userLabel” equals to undefined
Javascript is triggered before server-side saving, so the property with the new user value is not validated.
How can I update that so my event has the correct and updated user??
I have no problem server side, the data is always saved correctly because I retrieve the user whenever I hit the save button.

Hi,
by default scheduler doesn’t apply the changes that was made on updating data. You should explicitly enable this mode and specify properties to update:[code]public ActionResult Index()
{
var scheduler = new DHXScheduler(this);

scheduler.UpdateFieldsAfterSave();

}

public ContentResult Save(int? id, FormCollection actionValues)
{

var response = new AjaxSaveResponse(action);
response.UpdateField(“propertyName”, propertyValue);

return (ContentResult)response;
}[/code]
See the example:
s3.amazonaws.com/uploads.hipcha … operty.zip

btw, in your client side control, instead of: set_value: function (node, value, ev) { node.childNodes[0].nodeValue = ev.userLabel; }, get_value: function (node, ev) { return node.childNodes[0].nodeValue = ev.userLabel }you could use set_value: function (node, value, ev) { node.childNodes[0].nodeValue = value; }, get_value: function (node, ev) { return node.childNodes[0].nodeValue; }
then you won’t need to change the code if you use control somewhere else, or map it to other property

Thanks it worked but your code :

set_value: function (node, value, ev) { node.childNodes[0].nodeValue = value; }, get_value: function (node, ev) { return node.childNodes[0].nodeValue; }

it’s not working, because value is always “undefined”
I had to use my code(evaluating the “ev” object) and it’s working fine.