Good day friends,
I need some help with hiding certain Add New Event floating button in the Calendar plugin.
As attached below, I need to hide the GREEN plus button but leaving the RED and YELLOW appear.
Any help is appreciated.
Thank you and have a nice day.
Zala.
Calendar plugin hide certain Add New Event floating button
Calendar plugin hide certain Add New Event floating button
Zala.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Re: Calendar plugin hide certain Add New Event floating button
Just to follow up with this issue...
I managed to hide it with the following code in the browser inspector console.
However, I don’t have any idea where should I put this code.
Any help is appreciated. Thanks.
Zala.
I managed to hide it with the following code in the browser inspector console.
Code: Select all
document.querySelector('[title="New service completed"]').hide();
Any help is appreciated. Thanks.
Zala.
Zala.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Re: Calendar plugin hide certain Add New Event floating button
You could add it to the hooks/footer-extras.php file like so:
Code: Select all
<script>
document.querySelector('[title="New service completed"]').hide();
</script>

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- Need personalized consulting on your specific app and customizations? Book an online call with me here.
Re: Calendar plugin hide certain Add New Event floating button
Hi Ahmed,
Tried that but it didn't work as expected.
Please help. Thanks.
Tried that but it didn't work as expected.
Please help. Thanks.
Zala.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Re: Calendar plugin hide certain Add New Event floating button
Just to add error info in the console
Uncaught TypeError: document.querySelector(...) is null
I hope this will help.... Thanks
Zala.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Re: Calendar plugin hide certain Add New Event floating button
With the help from Pascal aka pböttcher, I would like to share the solution for this issue.
Add the following to the hooks/header-extras.php
in the arr
arr=['[title="New date2"]'];
you can specify the search for the buttons you want to hide. If you have multiple, use e.g.
arr=['[title="New date2"]', '[title="New date3"]'];
To get the button title, just hover your mouse pointer on the button and copy exactly what you see.
Thank you so much pböttcher.
Add the following to the hooks/header-extras.php
Code: Select all
<?php
$tablename=basename($_SERVER['PHP_SELF']);
$pos=strpos($tablename,'calendar');
if ( $pos !== FALSE && $pos == 0) {
?>
<script>
// set up the mutation observer
var observer = new MutationObserver(function (mutations, me) {
var arr=['[title="New date2"]']; // specify which button to hide
var elem=[];
arr.forEach((entry) => {
if (document.querySelector(''+entry+'') && $j(entry).css('display') != 'none') {
elem.push(document.querySelector(''+entry+''));
arr.splice(arr.indexOf(entry),1);
}
});
if (elem.length != 0) {
elem.forEach((element) => element.hide());
if (arr.length == 0) me.disconnect(); // stop observing
return;
}
});
// start observing
observer.observe(document, {
childList: true,
subtree: true
});
</script>
<?php
}
in the arr
arr=['[title="New date2"]'];
you can specify the search for the buttons you want to hide. If you have multiple, use e.g.
arr=['[title="New date2"]', '[title="New date3"]'];
To get the button title, just hover your mouse pointer on the button and copy exactly what you see.
Thank you so much pböttcher.
Zala.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.
Appgini 25.12, MacOS 15.5 Windows 11 on Parallels.