SamJ 0 Posted November 5, 2020 Report Share Posted November 5, 2020 https://www.w3schools.com/howto/howto_js_collapsible.asp Total noob, have some ideas, but still a bit unsure on the best approach. Was going to implement something similar to what's here (also see supplementary page) http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm thank-you! Quote Link to post Share on other sites
niche 142 Posted November 5, 2020 Report Share Posted November 5, 2020 Best to show some relevant code and go from there. Quote Link to post Share on other sites
SamJ 0 Posted November 5, 2020 Author Report Share Posted November 5, 2020 (edited) Don't have code, best got at this point, is pseudocode... To further flesh out what was thinking, does this sound about right? Missing steps or sub-steps? How to further flesh out each step/sub-step? Each of the collapsible tables should have a class. I’d need to; Create a button in dashboard.ejs that calls a function. This function should: Use a global boolean declared at the start of Dashboard.js to indicate if the tabs should be OPEN or closed Get an array of all of the elements with the above class For each element, check if it is currently open or closed, and simulate a click on the element if I need to change it to match the boolean Change the appearance of the button to indicate what clicking on it should do (so if clicking on it would expand everything, something like “EXPAND”, or “COLLAPSE” for the opposite) Edited November 5, 2020 by SamJ Quote Link to post Share on other sites
niche 142 Posted November 5, 2020 Report Share Posted November 5, 2020 Create a HTML doc with a <div>, put something in it and post your code. That's most of us got started. Quote Link to post Share on other sites
SamJ 0 Posted November 17, 2020 Author Report Share Posted November 17, 2020 Most of the main files are attached, & some further updates/commentary here:https://dev.to/saulhj/toggle-at-top-of-the-page-to-expand-collapse-all-headers-elegant-solution-2jac Essentially, only worked on the dashboard.ejs file - thus far. But eventually need to do some stuff in dashboard.js, & possibly style.css. Help, is greatly appreciated.... Thanks again. dashboard.ejs dashboard.js style.scss Quote Link to post Share on other sites
SamJ 0 Posted November 18, 2020 Author Report Share Posted November 18, 2020 Further developments (ongoing/WIP) in the discussion thread here...https://dev.to/saulhj/toggle-at-top-of-the-page-to-expand-collapse-all-headers-elegant-solution-2jac Sorry, not going to post same stuff in multiple spots at once, hope folks here aren't pedantic about this sort of thing. Can always continue our own separate help discussion here, after you've seen what's going on there. Thanks again. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.