Hello,
I am using the SchedulerStatic on multiple pages with different settings. But I have the problem that I cannot disable plugins?
For example the scheduler on one page has
scheduler.plugins({ active_links: false )})
But as soon as I go to a different page where the active_links is set to true, it is the case for all pages, even when I explicitly set it to false.
- Visit page A with disable active_links = ok
- Visit page B with enabled active_links = ok
- Visit page A with disable active_links = problem (and I made sure that the function setting the plugins actually runs again)
Everything else that differs between the schedulers works (different layouts, functionality etc, only the plugins refuse to be set back to false, once they have been set to true)
Hello @HVossi92,
Unfortunately currently there is no way to disable specific plugins after initialization. So there only two possible ways to disable plugins:
-
Create new scheduler instance
-
Disable configs that are parts of specific plugins, so you won’t disable a plugin, but disable its functionality.
For example:
// Initialize plugins
scheduler.plugins({
multisection: true
});
scheduler.config.multisection = true;
Then disable this config for another page:
scheduler.config.multisection = true;
Or in case of active_links
you can set additional css for specific pages in your app, like follows:
.dhx_month_head a{
color: inherit;
cursor: default;
text-decoration:none;
}
Here is a demo:
https://snippet.dhtmlx.com/uun928fi
So it will disable the active links functionality.
Best regards,
Hello Siarhei,
thanks for your answer, but in your demo the active_links are still enabled and clickable. In our case this would confuse users and not work with our setup, meaning we are currently unable to use active_link_view in any of our pages.
The following workaround seems to work for us, but it would of course be nicer to set this properly via Dhtmlx configs:
const elements = document.querySelectorAll(‘.dhx_scale_bar’);
elements.forEach((element) => {
const link = element.querySelector(‘a’);
if (link) {
element.textContent = link.textContent;
element.removeAttribute(‘data-link-date’);
}
});
Enabling the plugin and disabling the config works perfectly in other cases, though.
Hello @HVossi92,
Oh, thank you for the update, look like I really missed this thing. I already sent request to the dev team, and they will add specific config to disable/enable active links functionality ASAP.
And nice that you was able to find a correct workaround.
Kind regards,