Scheduler config and custom form

Hi,

I have several questions about the scheduler mobile.

1°) When i want to configure, i’m oblige to write the code on the outside of any method while i would like configure the scheduler before his initilization inside a methods named InitScheduler() for example. I tried different ways but its don’t work :cry:

2°) Moreover i use a custom form for adding or editing event. I would like populate dynamically a selec control but i’m obliged to configure the scheduler before the method call…

to summarize, I would like :

:arrow_right: create a function that I can call when I want.

[code]function initScheduler() {

/**************************************************/
/Here configure ! but it doesn’t work !!!/
/*************************************************/
scheduler.config.init_date = new Date();
scheduler.config.form = eval("["
+ “{ view: “text”, id: ‘text’, label: “Nom”, name: ‘text’ },”
+ “{ view: “select”, id: “form_select”, css: “test”, type:“round”, options: [”
+ “]”
+ “},”
+ “{ view: “datepicker”, id: ‘start_date’, label: “Start”, timeSelect: 1, dateFormat: scheduler.config.form_date },”
+ “{ view: “datepicker”, id: ‘end_date’, label: “End”, timeSelect: 1, dateFormat: scheduler.config.form_date },”
+ “{ view: “textarea”, id: ‘details’, label: “Description”, width: 300, height: 150 },”
+ “]”);

/*/
/*Here populate + "{ view: “select”, id: “form_select” */
/
/

How to populate select?

/**************************************************/
/Here load scheduler ! it work !!!/
/*************************************************/
dhx.ready(function () {
dhx.ui({
view: “scheduler”,
id: “scheduler”,
scroll: true,
container: “divScheduler”
});

    dhx.i18n.fullDateFormat = "%d-%m-%Y %H:%i";
    dhx.i18n.setLocale();

    $$("scheduler").load("", "scheduler");

    $$('scheduler').$$('month').show();
    $$('scheduler').$$('buttons').setValue('month');

    $$("scheduler").$setSize(contentWidth, contentHeight - OFFSET_HEIGHT);
});

}[/code]

I don’t know what to do and I turn around to configure, populate the list, and initialize the scheduler.

thank you for your advice…

Hi, nobody has an idea ?

I don’t understand why my application is not configured correctly…

function initScheduler() {
    scheduler.config.init_date = new Date();

    scheduler.config.form = [
        { view: "text", id: 'text', label: "Nom", name: 'text' },
        { view: "select", id: "form_select", options: [
                { value: "none", label: "Do not repeat" },
                { value: "day", label: "Each day" },
                { value: "week", label: "Each week" },
                { value: "month", label: "Each month" }
            ]
        },
        { view: "datepicker", id: 'start_date', label: "Start", timeSelect: 1, dateFormat: scheduler.config.form_date },
        { view: "datepicker", id: 'end_date', label: "End", timeSelect: 1, dateFormat: scheduler.config.form_date },
        { view: "textarea", id: 'details', label: "Description", width: 300, height: 150 }
    ];

    // Permet de redimenssioner correctement le calendrier
    var OFFSET_HEIGHT   = 60;
    
    // Récupère la taille aproprié pour le calendrier
    var contentWidth    = $("#divScheduler").width();
    var contentHeight   = $("#divScheduler").height();

    dhx.ready(function () {
        dhx.ui({
            view: "scheduler",
            id: "scheduler",
            //scroll: true,
            container: "divScheduler"
        });

        dhx.i18n.fullDateFormat = "%d-%m-%Y %H:%i";
        dhx.i18n.setLocale();

        // Initialise la vu du calendrier
        $$('scheduler').$$('month').show();
        $$('scheduler').$$('buttons').setValue('month');

        // Redimensionnement 
        $$("scheduler").$setSize(contentWidth, contentHeight - OFFSET_HEIGHT);
    });
}

The form is not changed and i become crazy… I’m obliged to refresh the main web page to configure the form correctly…

I seen an error on the javascript by debogging with FireBug (pluggin FireFox)
i join file named “error code”, i don’t know if it have concequence for my problem ?

Thx for your helps, I need you :slight_smile:


Hi,

we have tested this form config in the sample dhtmlxScheduler_mobile_v35_120626/samples/01_basic/06_custom_form.html - the select appears.

You may attach a complete demo where we could reproduce the problem.

Hi !

I solved my problem ! :smiling_imp:

I working with ASP.NET. I call a “ScripManager” allowing to generate javascripts and call javascript methods.

In ASP.NET, in code behind C#, there are a Event named Page_Load used during the loading.

I called my script when the loading page was complete. The scheduler displayed well but the configuration don’t works.

Now I call my script during the loading page and the scheduler works !! the configuration works even !

I hope i helped everybody working with ASP.NET and use this scheduler.

thx for your help and your supports !