Disable button

I have custom fields like address,city state,zip code. i want to display these fields like when you click on Disabled button for repeat event (recurring), it is displaying the button and if click on enable it is hiding the buttons . can i add this (enable & disabled )button for my custom fields .

Yep, button can be added to any form section
Check
docs.dhtmlx.com/doku.php?id=dhtm … ion_header

I used this code for adding extra fields [code]scheduler.config.lightbox.sections = [ {
name:“subject”,
height:20,
map_to:“title”,
type:“text” ,
button:“help”

},{
name : “address1”,
height : 50,
map_to : “address1”,
type : “text”,
//focus : true
},
{
name : “address2”,
height : 50,
map_to : “address2”,
type : “text”,
//focus : true
},
{
name : “city”,
height : 50,
map_to : “city”,
type : “text”,
//focus : true
} [/code]
where can i keep this below code.

scheduler.locale.labels.button_help="Help label"; scheduler.form_blocks.textarea.button_click=function(index, src, sec, data){
can you explain .

You can add such code in any place before scheduler.init ( can be on the same page, or moved to separate js file - it doesn’t matter )

Yes, i added the code like this

[code]scheduler.locale.labels.button_help=“Help label”;
scheduler.form_blocks.text.button_click=function(index, src, sec, data){}
scheduler.config.repeat_date = “%m.%d.%Y”;
scheduler.config.lightbox.sections = [ {
name:“subject”,
height:20,
map_to:“title”,
type:“text” ,
button:“help”

},
{
name : “description”,
height : 50,
map_to : “text”,
type : “textarea”,
focus : true
},
[/code]
after that i got the button with no action.
–> I need to keep my custom field in encapsulation mode like (Recurring).

Check the attached sample - button click handler works, and code is the nearly the same as above one ( I have changed “text” to “textarea” , because there is no such default form-block )
1282815689.zip (48.7 KB)

Hi Stanislav,
Yes , the attachment you send in that the button is working.
and before you send these code

scheduler.locale.labels.button_help="Help label";
    scheduler.form_blocks.textarea.button_click=function(index, src, sec, data){
[/code] .
So that i used your code like this to disable or enable my custom fields like(Recurring type).
i followed your code like this 
[code]scheduler.form_blocks.text.button_click = function(T, U, S) {
	T.open = !S.text;
	if (S.event_pid && S.event_pid != "0") {
		T.blocked = true
	} else {
		T.blocked = false
	}
	I.start = S.start_date;
	scheduler.form_blocks.text.button_click(0,
			T.previousSibling.firstChild.firstChild, T, T);
	if (U) {
		R(U, I)
	}
};

I didn’t get my output . :confused:
CAN YOU PLEASE TELL ME THE PROCEDURE FOR MY CUSTOM FIELDS TO KEEP IN A SINGLE BUTTON .

Check the attached one.
Copy-pasted code from recurring.js works fine.
97349234_2.ZIP (49.9 KB)

HI Stanislav,
Exactly what i need you sent in that attachment ,Thank you for that.
for me the problem is where should i placed my custom text fields,
I am using both dhtmlxscheduler_recurring.js and dhtmlxscheduler.js in my project and that custom fields are added in the dhtmlxscheduler_recurring.js .

i have a quick question.

I’v created some recurring events. When a visitor clicks on one of the events he first gets a pop-up with the question if he wants to edit all the recurring items. But the visitor has no rights to do this so i want to disable this pop-up for visitors. is this possible?

Yes Marklar,
You can use dhtmlxscheduler_readonly.js

dhtmlxScheduler\codebase\ext

for the visitor viewers .
Then the viewer can only view the events , he is not able edit your(Admin) event .

thnx!
What should i do/edit/remove in this file?

Hi Marklar ,
exactly what you to edit / what you want to remove

HI Stanislav,
Exactly what i need you sent in that attachment ,Thank you for that.
for me the problem is where should i placed my custom text fields,
I am using both dhtmlxscheduler_recurring.js and dhtmlxscheduler.js in my project and that custom fields are added in the dhtmlxscheduler_recurring.js .

Adding modifications to the existing js file is the bad practice - you will have problems during updates on the next version.

Normally you can place the custom fields directly in the html page, where scheduler resides. The only piece of code, which you need to use from _recurring.js in lightbox config.

scheduler.config.lightbox.sections=[ {name:"description", height:130, map_to:"text", type:"textarea" , focus:true}, ... code of your custom sections here... {name:"recurring", height:115, type:"recurring", map_to:"rec_type", button:"recurring"}, {name:"time", height:72, type:"time", map_to:"auto"} ];

You can place it anywhere before scheduler.init - so it will redefine default configuration of lightbox

Be sure to leave two last sections as they is , or recurring events will not be calculated correctly.

i’m not a coder at all. I just want the visitors not get annoyed by a popup asking them something. Do you know what code i have to edit in that file?

YES, Stanislav,
Now i got the functionality of the button , who can i insert my text fields into the button functionality .

             Thank You Very Stanislav.

Hi Stanislav ,
The button i inserted is hiding only one Text field ,or my Textarea . i am having four text fields and these test fields will go under only one button to Enable ,or Disable (like for recurring events).

       Thank you for Guiding me ,
                RAJESH.CH

Just create a custom form block instead of textarea
Follow
docs.dhtmlx.com/doku.php?id=dhtm … om_editors
dhtmlxScheduler\samples\02_customization\05_custom_editor.html

and use button with it.

Hi,Stanislav
I created a custom block for keeping my text fields like you told

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

Address1 
Address2 
City  
“;
},
set_value:function(node,value,ev){
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();
}
}

[/code]
and i got that one, but i want keep the button , for that i used this code

scheduler.form_blocks.text.button_click = function(index,el, section, cont){ if (!cont.open && !cont.blocked){
But here my button is not activated . can you tell me which one to use in place of (text or textarea)[scheduler.form_blocks.text.button_click]
i mapped like this

[code]{
name : “address”,
height : 50,
map_to : “address1”,
type : “my_editor”,
button:“help”

}[/code]