SamJ Posted November 5, 2020 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! Link to comment Share on other sites More sharing options...
niche Posted November 5, 2020 Share Posted November 5, 2020 Best to show some relevant code and go from there. Link to comment Share on other sites More sharing options...
SamJ Posted November 5, 2020 Author 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 Link to comment Share on other sites More sharing options...
niche Posted November 5, 2020 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. Link to comment Share on other sites More sharing options...
SamJ Posted November 17, 2020 Author 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 Link to comment Share on other sites More sharing options...
SamJ Posted November 18, 2020 Author 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now