Lightbox select


#1

I want to fill conditional data in lightbox select. Ex.
For User role admin I want to fill A,B
For User role staff I want to fill B,C

In dhtmlx scheduler I want to load data for all three options (A, B, C) but when create an event at that time on the basis of role I have to show selected options in select box.

When I do from back end side, it shows only two options events, third one option event data are not loaded in calendar. Ex.

If I send light box select options “B,C” and load data “A,B,C”. It loads only “B,C” options data in calendar.

If I did filtration in view for new event or update event light box is not loaded. It automatically adds new event without open lightbox in calendar


#2

Show ABC and remove C by role.


#3

Hi @dhimmartejas

please show some code so we could get a better idea of how you load options into the scheduler and how it’s configured.

It automatically adds new event without open lightbox in calendar

This either means there is script error on the client that prevents the lightbox from opening (have you checked the browser console for error messages?), or that details_on_create config is disabled:

//js:
scheduler.config.details_on_create = true;

the behavior of the lightbox shouldn’t depend on the way options are loaded.
I think the simplest solution for your use case is filtering options on the server since the user role is known at that point.
I don’t know how you implement data loading, but generally, you have complete control over what events are loaded into the scheduler. Meaning that in all cases you manually select events from the data source and feed them into the scheduler, unless you define any kind of filters, the scheduler will load all events you provide it with. So if some events are missing from the scheduler - you usually need to

  1. check your server code that selects and prepares events before loading them into the scheduler - does the event list look as expected at that stage?
  2. check the client-side scheduler to see what events are loaded into the internal data store https://docs.dhtmlx.com/scheduler/troubleshooting.html#checkwhatisloadedintothescheduler . If events are there but not displayed - probably filters for client-side filtering are configured incorrectly http://scheduler-net.com/docs/filtration.html https://docs.dhtmlx.com/scheduler/filtering.html

If you still have issues, please share some kind of example that we could run locally, or at least some code snippets of your configuration which would give the idea of how the scheduler is configured in your app.