Populate custom fields - Mobile Scheduler

Good morning,

Is there an event or template for the edit details form where I can populate custom fields with data based on the selected event?

Kind regards,

Chris.

Hi Chris,

Are you using “recurring events” library ?

No. We have no need for recurring events.

Our mobile scheduler page simply consists of custom controls (mainly HTML Selects) within the new_event_data template.

However, when we edit an event (via the standard ‘Edit’ button on the selected_event page) the HTML Selects are not populated.

From your documentation, I can see that there is no ‘edit_event-data’ template. Such a thing would solve my problem unless you can advise me of an alternative solution that already exists.

However, when we edit an event (via the standard ‘Edit’ button on the selected_event page) the HTML Selects are not populated.

Are you use “select” control ?
docs.dhtmlx.com/touch/doku.php?i … ols#select

If the event contains property that correspond custom control, the option will be selected.

Please attached a demo where we could reproduce the problem.

Yes, I am using 6 select controls.

The issue I have is that the sixth control is populated by the fifth, fifth by the fourth, fourth by the third etc etc, but there is no template to initialize the change event of the first dropdown.

They are populating correctly in the ‘new_event_data’ template (when the ‘new_event_data’ initializes, selectOne.change() is called which subsequently populates the other dropdowns).

All I need is an ‘edit_event_template’ or equivalent…

Hello,

You can set onChange event handler for Touch controls using attachEvent method:

$$("scheduler").$$("selectId").attachEvent("onChange",function(){ var value = this.getValue(); // your code });

That is the kind of thing that will start the population chain of the selects, but, there is nowhere for me to call the .onChange event.

For example, in the ‘new_event_data’ template, you can attach events and call those events so that when you click the ‘new_event’ button, those events are created, attached and executed correctly.

However, there is nowhere to call the events when the edit details form is shown.

Again, a solution to my problem would be an ‘edit_event_data’ template, an event called ‘onEditExistingEventClickBeforeFormControlRender’ (or similar/not as verbose).

You can set click handler for “edit” button:

$$(“scheduler”).$$(“edit”).attachEvent(“onItemClick”,function(){
// your code
});

This event is being called at the point where I needed it to, however, it isn’t executing .change() events to populate the HTML Selects.

Is there an ‘onAfterItemClick’? Can you send me all of the events that can be attached?

Can you send me all of the events that can be attached?

Scheduler library is based on Touch library. And here is the complete documentation for it:

docs.dhtmlx.com/touch/doku.php

Is there an ‘onAfterItemClick’?

Nope, there is not such an event

I have attached the demo possibly it will help to solve the issue
demo.zip (91 KB)