jQWidgets Forums

jQuery UI Widgets Forums Scheduler Set color in openDialog from style or backgroud fields

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 5 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • safraga
    Participant

    Hello,
    Is it possible to select the predefined color form Style or Background datafields in the edit dialog when you want to edit an existing appointement.

    $("#scheduler").jqxScheduler({
            theme: theme,
            width: '100%',
            height: '100%',
            source: adapter,
            rowsHeight: 10,
            editDialog: editDialogEnable,
            editDialogDateTimeFormatString: 'dd MM yyyy HH:mm',
            contextMenu: contextMenuEnable,
            localization: localisation_fr,
            showLegend: true,
            editDialogCreate: function(dialog, fields, editAppointment) {
                $('#participantField').show();
                fields.statusContainer.hide();
                fields.timeZoneContainer.hide();
                fields.colorContainer.show();
                var deleteButton = fields.buttons.children().eq(1);
                deleteButton.click(function() {
                    var appointment = currentClickedAppointment.jqxAppointment;
                    if (appointment.isRecurrentAppointment()) {
                        var funcType = 'updateExceptions';
                        var apptId = appointment.id;
                        var recurrenceException = appointment.recurrenceException.toString();
                        $.ajax({
                            type: "POST",
                            url: "api/apptEdit.php",
                            data: {
                                funcType: funcType,
                                apptId: apptId,
                                recurrenceException: recurrenceException
                            }
                        });
                    }
                });
                $("#dialogscheduler").children().last().before($("#participantField"));
            },
            resources:
                {
                    colorScheme: "scheme05",
                    dataField: "type",
                    source:  apptTypes
                },
            appointmentDataFields:
                {
                    id: "id",
                    subject: "subject",
                    location: "location",
                    description: "description",
                    from: "start",
                    to: "end",
                    allDay : "allday",
                    resourceId: "apptType",
                    recurrencePattern: "recurrenceRule",
                    recurrenceException: "recurrenceException",
                    draggable: "resizable",
                    resizable: "resizable",
                    style: "background",
                },
            view: schedView,
            views: schedViews
        });

    What I would like to do is fields.color = style of my appintement in openEditDialog.

    Thank you for help
    Best regards


    Hristo
    Participant

    Hello safraga,

    You could use the classes to change its colors.
    I would like to suggest you this approach:

    [class^="jqx-scheduler-edit-dialog"] {
    	color: red;
    	font-weight: bold;
    }

    About the other approach where using the fileds element could you clarify?
    Which children element do you want to change?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    safraga
    Participant

    Hello,
    thank you for your answere, what I want is to change the color of the appointment with the fields.colorContainer. (this part works fine).
    Next when we edit the appointment I want to set the colors I choosed before in the fields.colorContainer.

    I retrew the color by setting the style of the appointment from the database.

    Create the appointment with a color works fine (Store in database a blue appointment is ok)
    Load appointment from database with style works fine. (load from database a blue appointment is ok)

    Edit the appointment and set the right color from style into color fields container not work (Only select color is selected in the dropdown list of color)

    Maybe you understand beter now, my english is not so good.

    Best regards


    Hristo
    Participant

    Hello safraga,

    When you use the edit option the dialog should be created and you need to use the same logic in the editDialogOpen” callback.
    Try on that way and let me know if this does not help you.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.