Scheduler, select the default resource?

When adding an event in the popup of the scheduler, how to select by default a resource determined by a default parameter, or the last one used, stored for example in cookies? For example that Test 2 is selected by default instead of Test 1.

Capture d’écran 2022-10-03 à 11.30.34.png

1 Reply

RV Ravikumar Venkatesan Syncfusion Team October 4, 2022 12:19 PM UTC

Hi Chris,


Greetings from Syncfusion support.


We have validated your query “select the default resource?” at our end. You can set the default value to the resource dropdown while adding an appointment with help of the popupOpen event of the Schedule as shown in the below code snippet.


Sample: https://stackblitz.com/edit/ej2-js-schedule-set-default-selected-resource?file=index.js


[index.js]

    popupOpen: (args=> {

        if (args.type == "QuickInfo") {

            args.cancel = true;

            var currentAction = args.target.classList.contains("e-work-cells") ? "Add" : "Save";

            scheduleObj.openEditor(args.datacurrentAction);

        }

 

        if (args.type === 'Editor') {

            if (!args.data.Id) {

                args.element.querySelector('.e-OwnerId.e-dropdownlist').ej2_instances[0].value = 3;

            }

        }

    },


Kindly try the shared solution and let us know if you need any further assistance.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon