No clue where would be the best place to post this as I imagine multiple technologies could be involved.
I have PHP script generating a page based on values in a MySQL database, and I can't seem to wrap my head around how to code a feature I want. If someone could give me a nudge in the right direction, I'd sure appreciate it.
The raw output looks something like this:
If I have multiple entries for a date, all but the first line for that date would be output in a hidden div below the first date, and a plus sign (or some other icon) would appear next to the first date that the user can click to display the hidden other lines for that date:
After clicking the plus sign to show the hidden 04/09 events, the hidden lines appear and the plus sign changes to a minus which the user can click to re-hide the extra 04/09 events:
One problem (I think) is that I won't know I have multiple entries for a date until I'm looping through the database results, so this all has to be done on the fly, programatically speaking, unless someone knows a cool way to walk the DOM after the page is output and do the grouping/collapsing at that time.
Any thoughts?
I have PHP script generating a page based on values in a MySQL database, and I can't seem to wrap my head around how to code a feature I want. If someone could give me a nudge in the right direction, I'd sure appreciate it.
The raw output looks something like this:
Code:
Date Time Reading
04/09/2015 06:02PM 40375
04/09/2015 09:22AM 40365
04/09/2015 07:06AM 40351
04/08/2015 11:19AM 40349
04/05/2015 05:29PM 40283
If I have multiple entries for a date, all but the first line for that date would be output in a hidden div below the first date, and a plus sign (or some other icon) would appear next to the first date that the user can click to display the hidden other lines for that date:
Code:
Date Time Reading
+04/09/2015 06:02PM 40375
04/08/2015 11:19AM 40349
04/05/2015 05:29PM 40283
After clicking the plus sign to show the hidden 04/09 events, the hidden lines appear and the plus sign changes to a minus which the user can click to re-hide the extra 04/09 events:
Code:
Date Time Reading
-04/09/2015 06:02PM 40375
04/09/2015 09:22AM 40365
04/09/2015 07:06AM 40351
04/08/2015 11:19AM 40349
04/05/2015 05:29PM 40283
One problem (I think) is that I won't know I have multiple entries for a date until I'm looping through the database results, so this all has to be done on the fly, programatically speaking, unless someone knows a cool way to walk the DOM after the page is output and do the grouping/collapsing at that time.
Any thoughts?