I am not for sure the reason someone would want this ability since the page remembers the way a user sets it but. We are just the programmers, right?
So, I wanted to share what I have done in hopes that someone can take it to the next step.
function toggleAllIndicator(target) {
let sections = [
"billing_ps_expand",
"demograhics_ps_expand",
"pnotes_ps_expand",
"patient_reminders_ps_expand",
"disclosures_ps_expand",
"amendments_ps_expand",
"labdata_ps_expand",
"billing_ps_expand",
"vitals_ps_expand"
];
sections.forEach( element => {
toggleIndicator(target,element)
});
}
<div style='margin-top:10px' class="main"> <!-- start main content div -->
<a href="#" id="collapse-expand" class="" onclick="toggleAllIndicator(this)">Expand All</a>
This partially works.
It will expand all the sections on the screen but the demographics. What I was trying to do was to leverage the tech already on the page. Since the manual toggle worked, I thought what if the system just looped through the toggle and that does work. But it is a one-way toggle. It will only expand. It will not collapse.
Let me know what you think @visolve-116