Read only map_field

may i set one textarea in ligthbox to readonly

scheduler.form_blocks.textarea.set_value=function(node,value,ev){ node.firstChild.value=value||""; node.firstChild.disabled = ev.disabled; // or just = true; to disable for all events }

tried this, but it readonly all textarea in ligthbox …

Just need to set up field that cant modified throw form

You can create a custom form block, just copy paste code block related to textarea, rename “textarea” to “rotextarea” and you will have new form block type. Which can have separate logic ( can be readonly, while default textarea will continue to work as is.

docs.dhtmlx.com/doku.php?id=dhtm … om_editors

[code] scheduler.form_blocks[“rotextarea”]={
render:function(sns){
return “

”;
},
set_value:function(node,value,ev){
node.childNodes[0].value=ev.user||"";
		},
		get_value:function(node,ev){
		//	ev.user = node.childNodes[1].value;
			return node.childNodes[0].value;
		},
		focus:function(node){
			var a=node.childNodes[0]; a.select(); a.focus(); 
		}
	}

scheduler.locale.labels.section_typevisit = “Тип визита”;
scheduler.locale.labels.section_userselect = “Пациент”;
scheduler.locale.labels.section_description = “Описание”;
scheduler.locale.labels.section_doctor = “Доктор”;
scheduler.config.lightbox.sections=[
{ name:“typevisit”, height:22, map_to:“type”, type:“select”, options:scheduler.serverList(“type”)},
{ name:“userselect”, height:90, map_to:“patient”, type:“rotextarea”, focus:true },
{ name:“description”, height:90, map_to:“text”, type:“textarea”, focus:true },
{ name:“doctor”, height:23, type:“timeline”, options:elements , map_to:“section_id” },
{ name:“time”, height:72, type:“time”, map_to:“auto”}
][/code]

it load value to rotexarea, but popup error
TypeError: Result of expression ‘document.getElementById(F[A].id)’ [null] is not an object.
not load doctor that in timeline

when change textarea to input all work’s

all working :slight_smile: