Customer fORM

Hallo DHX Team,

I gotta question about customizing my Details form at your product SCHEDULER:

I read the tuturial about customizing forms and could recreate it of course, but for sure i have not get it in depth what happend…

Could you try to explain me the functions set get and focus?

I mean, if i add another field to the form, i have to add this one to the events.php at the end of the “render_table” function, right?

Also i have to mention it in the my_Editor render fucntion (the one with (sns)…) like



But now it stopps. Where are these NODES for? Haven’t find a clue in Documents or KBase.






                ev.occupation= node.childNodes[4].value;

                return node.childNodes[1].value;


where are the Numbers from? How could i add more fields and how i have to call them? like above OCCUPATION?

So sorry taht i have no clue, but want to make it… I like thisfree scheduler :slight_smile:

Another question is,if there is any Example fo radduing a checkbox to form.

If there is anywhere an example of another Hand-Made Form than the one in the documents, i could try to get it out on my own :slight_smile:)

Thanks, Homer

Each time when form is show, for each section set_value method is called, its purpose - fill data in related columns.
After filling data , for the section which has focus = true , focus method is called, its purpose - set initial focus to the form ( it is expected that only one section has such configuration option )
When user finish edit operation, and Save button is pressed - for each section in the form get_value method is called, its purpose - take data from the form and save in related event object.

>>to add this one to the events.php at the end of the “render_table” function, right?
If you want to load it from DB and save changes back to DB - right , it need to be added to the list of fields in render_table or render_sql command.

>>Where are these NODES for?
The node gives you the pointer to the top html element described in the render event.
In your case node will point to the


So you can use

return node.nextSibling.value;

>>How could i add more fields and how i have to call them?
Do you want to add many unique sections or use the same section for many fields?

I got two Sections, like in the custom_form example and renamed the drop-down-box and gave her new values… works fine!
Bu tnow i want to use a few textfields in the first section. And yes, they should be synced with Database.

When i get it right i have to write the field in the render_table in the order they approach in my form?
Have not get the thing with the Nodes exactly… so sorry!
For example i use Forname, Name and occupation i write the render_table like …,forname,name,occupation);
and how to change the set_ get_ and focus_ functions correctly?
Is FORNAME then [4], NAME [5] and OCCUPATION like [6] ???
Or have i got it totally wrong? :slight_smile:

I would try to get it on my own, but nowhere find an example with three or more datafields :confused: The example in the SAMPLE Section just uses TEXT for eventtext,m but i killed this one in database :slight_smile:

at the moment i use something like this (totally worng :frowning: ):

                ev.forname = node.childNodes[4].value;
       = node.childNodes[5].value;
                ev.occupation = node.childNodes[6].value;
               return node.childNodes[1].value;
                var a=node.childNodes[1];; a.focus();

For sure there is not yet a checkbox :slight_smile:

Hello again,

I am really frustrated right now :frowning:
I spend the last 3 Hours to get my form working, but it seems like i am unable to, or i got something wrong…
I think it should be sooo easy…
I will start all-over again and try to descripe in detail what i want to do (perhaps i can’t do it with the form??).
I want to fill four fields, in German they are called Vorname (Forname), Nachname (Name), Telefon (Phonenumber) and Bemerkung (Comment).
There is ione more field called Art (means soemthing like “what kind of”). The “art” field is filled through the selectbox perfectly, bur don’t want a single section for the four field above, so i want to put them all in one section (the first one)… I think it is easy for you to get my point when you see my code.

1.] I use a Database (SQL)

2.] I use two Sections
    { name:“description”, height:80, map_to:“text”, type:“my_editor” , focus:true},
    { name:“art”, height:21, type:“select”, map_to:“art”, options:[
        {key:“sprechstunde”, label:“Sprechstunde”},
        {key:“eeg”, label:“EEG”},
        {key:“nlg”, label:“NLG”},
        {key:“uU”, label:“u.U.”},
        {key:“gt”, label:“GT”},
        {key:“mmpi”, label:“MMPI”},
        {key:“rehacom”, label:“RehaCom”},
        {key:“duplex”, label:“Duplex”},
        {key:“pt”, label:“PT”}
    { name:“time”, height:72, type:“time”, map_to:“auto”}

3.] My my_editor looks like this
        return “





4.] I use a custum view to overwrite the
    return "Patient: “+event.vorname+” “+event.nachname+”_________ "+"Telefon: “+event.telefon+”_________ "+“Art: “””;

O.K., i missed some information?
I mean, my set_value/get_value/focus-Functions are not working… I can’t get the point of the Nodes and Sibblings :frowning:

Could somebody help me out?
Will help to find all errors, just ask me for more informations…

Thanks in advance,

Hi again,

i actually asked a friend who’s tough in coding, but he was not able to help me out with the little form :-/
Could you help me out Support Team? :frowning:

Seems like i am lost right now at this point of developing :confused:

Partially working sample is attached ( it doesn’t have a server side, but the code which you have mention above must work )

render method provides incorrect HTML , top level div tag is not closed - was fixed
hardcoded height was changed to the settings from config

first line locates all inputs in your template, other places related values in inputs
var inps = node.getElementsByTagName(“INPUT”);

first line locates all inputs in your template, other moves values from inputs to event object
var inps = node.getElementsByTagName(“INPUT”);
ev.nachname= inps[0].value;
ev.vorname= inps[1].value;
ev.telefon= inps[2].value;
ev.bemerkung= inps[3].value;
just the same, locates the inputs and move focus to the first
var inps = node.getElementsByTagName(“INPUT”);

912739213.ZIP (35.9 KB)

Hello to Russia,

I am totally happy about your detailed answer! Very, very, very thank you!
After testing and workingwith your code i made it :slight_smile:

But there are just two little Problems after your Implementation:
1.] When i will add an event, every field is filed with “undefined”, how to make their value clear like before?
2.] When i click on add event my scheduler.templates.event_text=function(start,end,event) works fine, and gets filled by the values i just added.
Also when i go into detail view everything is at the right place.
But when i reload the whole site, i get an “undefined” for the value of nachname. Even if i go into detail mode there is undefined in the field of nachname.
Every other field is filled correctly.

Checked the log and get the following:
Log started, 15/10/2009 07:10:45

DataProcessor object initialized
128_id => 128
128_start_date => 2009-10-15 09:15
128_end_date => 2009-10-15 10:15
128_text => undefined
128_vorname => Homer
128_telefon => 02203 9974731851
128_art => mmpi
128_bemerkung => Test Content
128_nachname =>
128_!nativeeditor_status => updated
ids => 128

Row data [128]
id => 128
start_date => 2009-10-15 09:15
end_date => 2009-10-15 10:15
nachname => Jousuf
vorname => Homer
telefon => 02203 99741851
art => mmpi
bemerkung => Test Content
!nativeeditor_status => updated

UPDATE events SET start_date=‘2009-10-15 09:15’,end_date=‘2009-10-15 10:15’,nachname=‘Jousuf’,vorname=‘Homer’,telefon=‘02203 99741851’,art=‘mmpi’,bemerkung=‘
Test Content’ WHERE event_id='128’

Edit operation finished
0 => action:updated; sid:128; tid:128;

Done in 0.0086979866027832s

Any idead? I have an idea and underlined the thing i meantioned…

1.] When i will add an event, every field is filed with “undefined”, how to make their value clear like before?
a) replace
and same for other inputs.


b) you can use onEventCreated handler to set default values for properties of new event

>>Even if i go into detail mode there is undefined in the field of nachname.
Problem is in loading code. The scheduler expects to have 3 mandatory fields : start date, end date, text and any extra fields after it. In your case you are providing only two mandatory fields ( you have not any field for the “text” )
With such config
third field “nachname” will be mapped to the “ev.text” , not to the ev.nachname
It possible to change server side config to provide correct mapping but it will require extra field in DB or some custom coding.
More simple approach is to tweak the client side mapping.

scheduler.attachEvent(“onEventLoading”,function(ev){ ev.nachname = ev.text; });

So i thought in the right way by getting that the “text”-field made the problem.
OK now i got that it is filled for third field, and i can just add a database coloum called text and let it empty all the time, no problem i think.
The second way seems to be more easy, but i am not sure, if i get problem later when i perhaps forget this cirsumstance or something :slight_smile:

Dear support, when i read your replys i can get the points where you are writing about and learn form it, very much thank you Guys (and girls?) :wink:

Best wishes,

Hello all of you,

i am a quite follower of thsi discussion and learned a few things out of it… Perhaps we should change contacts Homer? Seems like we have the same problems in coding and understadning :slight_smile:
I finally finsihed my project but still looking for some better handling, so i was interessted in the checkbox point:

Another question is,if there is any Example fo radduing a checkbox to form.

If there is anywhere an example of another Hand-Made Form than the
one in the documents, i could try to get it out on my own :slight_smile:)

(oh now the whole area turned into orange ?!)
So if it is allowed, may i ask you for the possibility of adding a checkbox into the form?
I mean, of course i can add one in HTML, but is the way to fill it exactly the same like with every normal textfield or area?

Hey again,

after helping me out with the lightbox stuff i found this topic.
i got no problems with adding fields, but also can’t build up a checkbox into it…
What is so special with it?

Any possibility to workaround for me?

The sample is attached.
Actually it can be added in the same way as any other control through custom “form block”

1256230676.ZIP (34 KB)