Suppress New Scheduler form

Hi.
Is there a way to suppress the New Scheduler form and instead use something else?

Also how does one attach a click to an event on the timeline view of Scheduler?

Thanks

Hello @Jeremy_Brown,

Is there a way to suppress the New Scheduler form and instead use something else?

The Scheduler widget, as well as most of our complex widgets (except Kanban and Spreadsheet) is built as a modularized app on Webix Jet, and the user can customize existing modules or add new ones. Modules are implemented as JetViews (ES6 classes) where any UI element, data-related service, or feature can be customized by the same rules. For more details about this architecture, please check the following blog article, which describes the general idea and reasons for this structure.

Please note that complex modifications may require observing the source code of the tool in order to build the most feasible solution that will correctly alter/extend the original logic.

Regarding this particular customization: the common way to access the relevant data at those specific points in time is to override the scheduler.views.main JetView class and provide your own logic for the ShowEvent() method. The ShowEvent() method acts as a common entry point for both the “add” and “edit” actions across different Scheduler modes, so it is probably the most convenient way to do so (unless you need some specific logic for certain modes).

Please take a look at the following example: Code Snippet. Here, we override the scheduler.views.main JetView with our own CustomMainView class, which defines its own ShowEvent() method. In this example, we don’t really do anything with the event data, and you also won’t see the regular form/info panel pop up.

We’ve also got another customization sample showcasing a similar use case, see Code Snippet. Please refer to our documentation to get more information on its functionality/implementation - How-tos of UI Complex Widgets, Scheduler Webix Docs.

Also how does one attach a click to an event on the timeline view of Scheduler?

If you simply want to access the onclick event for this mode specifically, then you can provide your own logic for the related onClick handler.

Please see the following example: Code Snippet.

Normally, the onClick handler for the “webix_scheduler_timeline_event” CSS class would call the inner ShowEvent() method, which would then also trigger the common ShowEvent() method from the aforementioned MainView (scheduler.views.main). So, you can also override just the inner ShowEvent() (as seen here - Code Snippet), or work with the common ShowEvent() logic (as seen in the very first example).

@Dzmitry Thanks for the response.

Last question (I hope): once a new event has been created with some other means, how do I get it to show up on the calendar? I haven’t figured that part out yet :frowning:

I’ve got all the event details from the external mechanism. How do I take that event now and display it?

Thanks

You can use the built-in API from the Operations service and call its addEvent() method to add a new event.

Please take a look at the following example: Code Snippet. In your case, make sure that the event object has the correct structure, so that it can be properly processed by the component (see Working with Data of UI Complex Widgets, Scheduler Webix Docs).