jQWidgets Forums

jQuery UI Widgets Forums Scheduler Custom fields not always shown

This topic contains 9 replies, has 2 voices, and was last updated by  Hristo 7 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Custom fields not always shown #92625

    crissi
    Participant

    Hello!

    I’ve added some custom fields to the dialog, but sometimes they’re not shown when the dialog is opend.
    After reloading the whole page, it’s working most of times, sometimes I have to reload the page more times.
    There is no error in console, and unfortunatly I’m not able to reproduce it.

    Can you give me any hint how to find the problem?
    If you need code, let me know!

    Thanks in advance!
    Chris

    Custom fields not always shown #92663

    Hristo
    Participant

    Hello Chris,

    This is strange behavior.
    You should create all the new things in the editDialogCreate.
    Do you add new appointments after initialization and how?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Custom fields not always shown #92687

    crissi
    Participant

    Hello!

    I’m loading data with json and dataadapter from mysql.
    Afterwards I’m doing nothing, just opening dialog for new event.
    All my custom fields are created in the editDialogCreate function:

    editDialogCreate: function (dialog, fields, editAppointment, event) {
    console.log(fields);
    // hide repeat option
    fields.repeatContainer.hide();
    // hide status option
    fields.statusContainer.hide();
    // hide timeZone option
    fields.timeZoneContainer.hide();
    //fields.timeZoneContainer.hide();
    fields.allDayContainer.hide();
    // hide color option
    fields.colorContainer.hide();
    //fields.resourceContainer.show();
    fields.locationContainer.hide();
    fields.subjectContainer.hide();

    patientContainer = “<div>”;
    patientContainer += “<div class=’jqx-scheduler-edit-dialog-label’>Paciente</div>”;
    patientContainer += “<div class=’jqx-scheduler-edit-dialog-field’><table width=’100%’border=’0′ cellspacing=’0′ cellpadding=’0′ ><tr><td width=’90%’><div id=’patient1′></div></td><td width=’10%’ align=’right’><button id=’btn_add_kontakt’></button></td></tr></table> </div>”;
    patientContainer += “</div>”;
    fields.resourceContainer.prepend(patientContainer);

    behandlungContainer = “<div>”;
    behandlungContainer += “<div class=’jqx-scheduler-edit-dialog-label’>Tratamiento</div>”;
    behandlungContainer += “<div class=’jqx-scheduler-edit-dialog-field’><div id=’behandlung1′></div></div>”;
    behandlungContainer += “</div>”;
    fields.resourceContainer.append(behandlungContainer);

    printButton = $(“<button id=’btn_print’ style=’margin-left: 5px; float:right; height:25px;’>Imprimir</button>”);
    fields.buttons.append(printButton);
    printButton.jqxButton({ theme: ‘orange’, template: ‘primary’ });
    printButton.click(function () {
    print_cita($(“#patnam_hide”).val(),fields.from.val(),fields.to.val(), $(“#behandlung_hide”).val(), false);
    });

    bestButton = $(“<button id=’btn_best’ style=’margin-left: 5px; float:right; height:25px;’>Confirmación</button>”);
    fields.buttons.append(bestButton);

    bestButton.jqxButton({ theme: ‘orange’, template: ‘warning’ });

    bestButton.click(function () {
    print_best($(“#patid_hide”).val(), fields.from.val(), fields.to.val());
    });

    fields.cancelButton.jqxButton({template: ‘inverse’});
    fields.deleteButton.jqxButton({template: ‘danger’});
    fields.saveButton.jqxButton({template: ‘success’});

    $(“#behandlung1”).jqxDropDownList({
    SelectedIndex: -1,
    source: dataAdapter_farbe,
    displayMember: “behandlung_name”,
    valueMember: “behandlung_id”,
    width: ‘100%’,
    height: 25,
    placeHolder: ‘Selecionar tratamiento…’
    });

    $(‘#behandlung1’).on(‘select’, function (event) {
    $(“#behandlung_hide”).val($(this).val());
    });

    $(“#patient1”).jqxComboBox({
    placeHolder: ‘Seleccionar paciente…’,
    width: ‘100%’,
    height: 25,
    source: dataAdapter_test,
    selectedIndex: -1,
    minLength:1,
    displayMember: “name”,
    valueMember: “int_id”,
    searchMode:’containsignorecase’,
    autoComplete:true,
    search: function (searchString) {
    console.log(searchString)
    dataAdapter_test.dataBind();
    }
    });

    $(“#patient1”).on(‘select’, function (event) {
    $(“#patnam_hide”).val(get_name($(this).val()));
    $(“#patid_hide”).val($(this).val());
    });

    $(“#btn_add_kontakt”).jqxButton({
    imgWidth: 18,
    imgHeight: 18,
    height: ’25px’,
    width: ’25px’,
    roundedCorners: ‘all’,
    imgPosition: “center”,
    textPosition: “left”,
    imgSrc: “images/icons/add.png”,
    textImageRelation: “imageBeforeText”
    });

    $(“#btn_add_kontakt”).on(‘click’, function () {
    $(“#neuerkontakt”).jqxWindow(‘open’);
    });
    },

    New events are added inside here
    $(“#scheduler”).on(‘appointmentAdd’, function (event) {
    });

    Custom fields not always shown #92768

    Hristo
    Participant

    Hello Chris,

    I try your settings (with alternative source different from yours) in our demo and it seems to work fine.
    Could you clarify the issue?
    Also, you could add some pictures.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Custom fields not always shown #92770

    crissi
    Participant

    Hello!

    Pictures aren’t a problem:
    Dialog ok
    Dialog not ok

    Exactly my custom fields are missing on the 2nd pic.

    Here is the whole code, maybe I have an error somewhere else?
    I just can’t understand, that it’s not working sometimes
    Code

    The includes for de JS files are missing here, this happens earlier…

    Thank you!

    Custom fields not always shown #92965

    Hristo
    Participant

    Hello Chris,

    You should show the used container fields.resourceContainer.show();. I change this in the “editDialogCreate” and it seems to work fine.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Custom fields not always shown #93024

    crissi
    Participant

    Hello,

    well, seems to work now!

    Just one more question – maybe there is another error somewhere in my code (what surely can be optimized 😉 )
    If my first action in the sheduler is to edit an appointment, the title of the editDialog is also edit for a new event.
    If my first action is a new event, also while editing an appointment the title is new event.

    Thanks!

    Custom fields not always shown #93058

    Hristo
    Participant

    Hello Chris,

    Could you clarify it?
    You want to understand when someone changes the title of the edited appointment.
    In this case, you could try to bind an event handler to the relevant field.
    Please, take a look at this example:

    fields.subject[0].addEventListener('keypress', function (event) {
        //Do something
    });

    (in the editDialogCreate)

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Custom fields not always shown #93099

    crissi
    Participant

    Hello,

    Maybe I was not clear enough:
    I load the scheduler with some events. Then I edit an existing appointment, and get the following (what’s good of course!):
    Edit apponitment
    Next I want to create a new appoinment, then it loos like this:
    Edit appointment

    Thanks

    Custom fields not always shown #93103

    Hristo
    Participant

    Hello Chris,

    I got it. Thank you for the feedback.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.