jQWidgets Forums

jQuery UI Widgets Forums Scheduler Dialog window Buttons

This topic contains 7 replies, has 3 voices, and was last updated by  manjulam 9 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Dialog window Buttons #79438

    Jacky
    Participant

    HI Peter, I wonder if I can remove the default buttons of the dialog window, like “Save, Delete, Cancle”.

    Dialog window Buttons #79441

    Peter Stoev
    Keymaster

    Hi Jacky,

    You can, by customizing the jqxScheduler’s Edit Dialog. Please, look at: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxscheduler/scheduler-edit-dialog.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dialog window Buttons #79442

    Jacky
    Participant

    Thanks, but in this demo, it shows how to add buttons, I want to remove or hide the default buttons.Just like hide the delete button.

    Dialog window Buttons #79444

    Peter Stoev
    Keymaster

    Hi Jacky,

    In the Scheduler’s demo is shown how to access the buttons using fields.buttons. Then by using a sub-property of the buttons object you will be able to access the particular buttons and call the hide() method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dialog window Buttons #82933

    manjulam
    Participant

    I have a requirement to check the status of an appointment and prevent deleting the appointment in some cases. I tried to hide the delete button in the editDialoOpen event but it did not work. This is what I have tried:

    editDialogOpen: function (dialog, fields, editAppointment)
    {

    if(editAppointment.status.toUpperCase() != ‘AVAILABLE’)
    {
    fields.deleteButton.hide();
    //fields.saveButton.hide();

    }
    },

    I am able to hide the save and cancel buttons, just not the delete button. Any guidance is appreciated.

    Dialog window Buttons #82942

    Peter Stoev
    Keymaster

    Hi manjulam,

    The deleteButton is shown/hidden dynamically by the Scheduler. If you want to remove it, use:

         $("#scheduler").on('editDialogCreate', function (event) {
                    var args = event.args;
                    var dialog = args.dialog;
                    var appointment = args.appointment;
                    var fields = args.fields;
                    args.fields.deleteButton.remove();
                    console.log("editDialogCreate is raised");
                });
    

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dialog window Buttons #82970

    manjulam
    Participant

    Thank you for the reply. Really appreciate your quick response. Our requirement is to hide/show the delete button conditionally.
    If that is not an option, is there a way to check a condition in the delete event of the appointment and in some way not remove the appointment from the calendar?

    I work for a small startup and I am evaluating the product features and our requirements. Quite happy with the product offering so far, and hope to find a good workaround for our requirements. I think it will be a good value addition to buy your product suite. Thank you.

    Manjula

    Dialog window Buttons #82971

    manjulam
    Participant

    I was able to disable and enable the delete button conditionally like this:

    if(editAppointment.status.toUpperCase() != ‘AVAILABLE’)
    {
    fields.deleteButton.jqxButton({ disabled: true });

    }
    else
    {
    fields.deleteButton.jqxButton({ disabled: false });
    }
    It would be nicer to hide the button though.

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

You must be logged in to reply to this topic.