How to limit the display of only the two configured in the config?

Hello,


I'm trying to limit the list of calendars in the popup to the list of resources chosen in the config.


For instance :

- in resources there are 3 calendars available

( test 1, test 2, test 3 )

- in the config I want to display only the first two.

(test1, test2)


For the moment the popup when adding an event offers me the 3.


How to limit the display of only the two configured in the config?

resources: [{
field: 'calendar_id', title: 'Calendriers',
name: 'Calendriers', allowMultiple: false,
dataSource: calendars,
textField: 'name',
idField: 'id',
colorField: 'color'
}],
popupOpen: (args) => {

if (args.type == "QuickInfo") {
if (typeof args.data.id === 'undefined'){
var dialogObj = args.element.ej2_instances[0];
dialogObj.hide();
var currentAction = args.target.classList.contains("e-work-cells") ? "Add" : "Save";
scheduleObj.openEditor(args.data, currentAction);
}
}

if (args.type === 'Editor') {
let id = args.data.id;
if (id) {
let eventsById = [];
scheduleObj.eventsData.forEach(function (s) {
eventsById[s.id] = s
})
$(args.element).find(".e-start")[0].ej2_instances[0].value = eventsById[id].StartTime;
$(args.element).find(".e-end")[0].ej2_instances[0].value = eventsById[id].EndTime;
}
$(args.element).find(".e-time-zone-row,.e-time-zone,.e-recurrenceeditor").hide()
}

},

Thanks



Attachment: printscreen_4fecb263.zip

2 Replies

CV Chris VINCENT October 3, 2022 08:21 AM UTC

I finally found, it is enough to send only the list of configured resources instead of all the calendars in:


resources: [{
field: 'calendar_id', title: 'Calendriers',
name: 'Calendriers', allowMultiple: false,
dataSource: calendarsshow, // list of configured resources uniquely
textField: 'name',
idField: 'id',
colorField: 'color'
}],


RV Ravikumar Venkatesan Syncfusion Team October 4, 2022 08:35 AM UTC

Hi Chris,


Greetings from Syncfusion support.


We are happy that you found solution to your problem. Kindly let us know if you need any further assistance on this.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon