scheduler.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true, button:"help"},
{name:"custom", height:200, type:"form", map_to:"section_id",button:"lost"},
{name:"time", height:72, type:"time", map_to:"auto"}
];
scheduler.locale.labels.button_help="Help label";
scheduler.locale.labels.button_lost="Lost";
scheduler.form_blocks.textarea.button_click=function(index, src, sec, data){
//called on button click
// index - index of section
// sec - html element of section header
// sec - html element of section editor
alert('pressed');
}
scheduler.form_blocks.form ??? get error undefined
how to get work button at custom form ???
type:“form”,
Is it your custom section type?
In such case be sure that problematic line was placed after code which defines your custom section logic.
yes “form” is my custom section
[code] scheduler.attachEvent(“onBeforeLightbox”, function (event_id){
scheduler.form_blocks[“form”] = {
render:function(sns) {
return "<div id='"+sv+"' style='height: 250px'></div>";
},
set_value:function(node,value,ev,config){
myForm = new dhtmlXForm(sv, formData);
},
get_value:function(node,ev,config){
},
focus:function(node) {
}
};
return true;
});[/code]
problem is to cathup button on custom form and show/hide section with dhtmlx form in it
like it working at rucirring, but have some problem with height, with attached form to section div
<script type="text/javascript" charset="utf-8">
var myForm;
function init() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.details_on_dblclick=true;
scheduler.init('scheduler_here',null,"week");
var formData = [
{type: "settings", position: "label-right"},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD", checked: false, list:[
{type: "select", label: "форма №", name:"FormB", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD1", checked: false, list:[
{type: "select", label: "форма №", name:"FormB1", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD2", checked: false, list:[
{type: "select", label: "форма №", name:"FormB2", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD3", checked: false, list:[
{type: "select", label: "форма №", name:"FormB3", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD4", checked: false, list:[
{type: "select", label: "форма №", name:"FormB4", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD5", checked: false, list:[
{type: "select", label: "форма №", name:"FormB5", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}]},
{type: "checkbox", label: "Загальний аналіз крові з лейкоцитарною формулою", name:"BLOOD6", checked: false, list:[
{type: "select", label: "форма №", name:"FormB6", options:[
{text: "", selected: true},
{value: "224", text: "224/о "}
]},
{type: "newcolumn"},
{type: "button", value: "+"},
{type: "newcolumn"},
{type: "button", value: "Направление"}
]}
];
scheduler.locale.labels.section_custom="Form";
scheduler.attachEvent("onEventAdded", function(event_id,event_object){
//any custom logic here
sv = scheduler.uid();
});
scheduler.attachEvent("onBeforeLightbox", function (event_id){
scheduler.form_blocks["form"] = {
render:function(sns) {
return "<div id='"+sv+"' style='height: 250px'></div>";
},
set_value:function(node,value,ev,config){
myForm = new dhtmlXForm(sv, formData);
},
get_value:function(node,ev,config){
},
focus:function(node) {
}
};
return true;
});
scheduler.attachEvent("onAfterLightbox", function (){
if (myForm) {
myForm.unload();
myForm = null;
}
});
scheduler.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true, button:"help"},
{name:"custom", height:200, type:"form", map_to:"section_id",button:"lost"},
{name:"time", height:72, type:"time", map_to:"auto",button:"lost"}
];
scheduler.locale.labels.button_help="Help label";
scheduler.locale.labels.button_lost="Lost";
scheduler.form_blocks.form.button_click=function(index, src, sec, data){
//called on button click
// index - index of section
// sec - html element of section header
// sec - html element of section editor
alert(index+src+sec+data);
}
}
</script>
TypeError: Result of expression ‘scheduler.form_blocks.form’ [undefined] is not an object.
TypeError: Result of expression ‘D.button_click’ [undefined] is not a function.
fixed thx
how about to show/hide section on pressed button ???