Disable button

Hi Stanislav,
Here i attached my screen short the way i arranged my custom fields in one block by using custom_editor.html . Now the button i added is not active to (Disable or Enable) you can see the code in the above post how i declare. can you please guided me .


There is no any special “enabled” or “disabled” state for the button.
You can have code in onclick, which changes text of the button

scheduler.form_blocks.my_editor.button_click = function(index,el, section, cont){
         if (!cont.open && !cont.blocked){
                ...
                el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;
         } else {
                ...
                el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;
         }

Hi Stanislav ,
exactly the same way i try ed scheduler.form_blocks.my_editor.button_click = function(index,el, section, cont){ if (!cont.open && !cont.blocked){ ... .But the whole Custom editor is not displaying [see the screen short for understand ]

Sorry i missed the attachment. Yes in place of Textscheduler.form_blocks.my_editor.button_click = function(index,el, section, cont){ if (!cont.open && !cont.blocked){.I replaced my_editor.button_click.
---->if you replace Text it will disable or enable Single Text Field .
---->if you replace Text-area it will disable or enable Single Text Area.

Stanislav,
the button i added for text-area is default showing Help label . After one click it showing Enable or Disable . but i need to show that when the light box is popup it should be in disable position (like recurring events)

add the next line to set_value code

node.open = false;
scheduler.form_blocks["recurring"].button_click(0,node.previousSibling.firstChild.firstChild,node,node);

Stanislav,
Here is my code i followed

scheduler.form_blocks.my_editor.button_click = function(index,el, section, cont){	
	  			if (!cont.open && !cont.blocked){
				cont.style.height="115px";
				e1.style.backgroundPosition="-5px 0px";
				el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;
			} else {
				cont.style.height="0px";
				el.style.backgroundPosition="-5px 20px";
				el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;
			}
			cont.open=!cont.open;
			
			scheduler.setLightboxSize();
			C("dhx_repeat_" + this.value).style.display = "block"
		};
	
scheduler.form_blocks ["my_editor"]={
				render:function(sns){
					return "<div class='dhx_cal_ltext' style='height:210px; font-size: 12px;'>address1<br/><input type='text' style='width: 410px; height:22px; background: #fefefe; border: 1px solid #bbb; font-family: 'Lucida Grande', Verdana, sans-serif; font-size: 14px; color: #333; padding: 7px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; outline: none; vertical-align: middle;'><br/></div>";
				},
				set_value:function(node,value,ev){
					node.open = false;
					scheduler.form_blocks["recurring"].button_click(0,node.previousSibling.firstChild.firstChild,node,node);
					node.childNodes[1].value=value||"";
					node.childNodes[4].value=ev.details||"";
				},
				get_value:function(node,ev){
					ev.location = node.childNodes[4].value;
					return node.childNodes[1].value;
				},
				focus:function(node){
					var a=node.childNodes[1]; a.select(); a.focus(); 
					return
				}
				}

still i have a problem with that button function . but the change here is that button is enable by default. and its not working.
And also i have problem with this statement scheduler.form_blocks.my_editor.button_click = function(index,el, section, cont){
if remove my_editor.button_click then its showing custom block

After adding the code node.open = false; scheduler.form_blocks["recurring"].button_click(0,node.previousSibling.firstChild.firstChild,node,node); see my light-box in screen short, but the is not functioning


When i click on the button i i got an in error console that is
---->Error: D.button_click is not a function
Source File: localhost:8080/ems/scripts/calen … heduler.js
Line: 3608

scheduler._init_lightbox_events = function() {
	this._get_lightbox().onclick = function(C) {
		var E = C ? C.target : event.srcElement;
		if (!E.className) {
			E = E.previousSibling
		}
		if (E && E.className) {
			switch (E.className) {
			case "dhx_save_btn":
				scheduler.save_lightbox();
				break;
			case "dhx_delete_btn":
				var F = scheduler.locale.labels.confirm_deleting;
				if (!F || confirm(F)) {
					scheduler.deleteEvent(scheduler._lightbox_id);
					scheduler._new_event = null;
					scheduler.hide_lightbox()
				}
				break;
			case "dhx_cancel_btn":
				scheduler.cancel_lightbox();
				break;
			default:
				if (E.className.indexOf("dhx_custom_button_") != -1) {
					var A = E.parentNode.getAttribute("index");
					var D = scheduler.form_blocks[scheduler.config.lightbox.sections[A].type];
					var B = E.parentNode.parentNode;
					D.button_click(A, E, B, B.nextSibling)
				}
			}
		}
	};
	this._get_lightbox().onkeypress = function(A) {
		switch ((A || event).keyCode) {
		case scheduler.keys.edit_save:
			if ((A || event).shiftKey) {
				return
			}
			scheduler.save_lightbox();
			break;
		case scheduler.keys.edit_cancel:
			scheduler.cancel_lightbox();
			break
			}
	}
};