angu-fixed-header-table icon indicating copy to clipboard operation
angu-fixed-header-table copied to clipboard

Support for max-height (via css & maxTableHeight) & fixes/improvements

Open brandonbird opened this issue 10 years ago • 10 comments

Includes some fixes brought in from @Dorian-Fusco's PR, but without dramatic changes to look/functionality of original directive.

From @Dorian-Fusco PR #13 :

  • Less promiscuous selectors.
  • Perform calculations on hidden clone rather than original element to prevent FOUCs.

Other fixes/improvements:

  • Perform transformTable when the number of rows of the tbody change to accommodate scrollbar disappearing/reappearing with live data. Updated demo with example.
  • Perform transformTable on throttled window resize so that the table columns aren't stuck at a maximum of their originally calculated size.
  • Increased scrollBarWidth trim to -4px. Testing the demo in several browsers/platforms seemed to indicate this was better than -2px.
  • Fix for IE9 tr height inheritance so that even though the directive fails it at least falls back to a normal looking table.

brandonbird avatar Aug 12 '15 21:08 brandonbird

I found and fixed an additional issue: If the first row in the tbody had colspan'd cells it wouldn't calculate the column widths correctly. It now finds the first row in the tbody that has the same number of columns as the thead with which to determine and apply preferred column width.

brandonbird avatar Aug 13 '15 15:08 brandonbird

Found some additional issues with colspan'd cells. Ended up rewriting the section where widths are determined and applied.

  • Loops through each of the table sections and applies width to every row’s cells directly from the equivalent cloned cell. This allows the proper width to be assigned to cells with colspan. Skips rows that have the same number of cells as the previous row for performance.
  • Changed scrollBarWidth compensation to apply to all the last columns of the tbodies, not just the last column of the first row.
  • Updated demo to show colspanning

brandonbird avatar Aug 13 '15 23:08 brandonbird

Wow, sorry for so many updates but I discovered that I could optimize the transform function changes I made in the last commit to walk over less of the DOM.

brandonbird avatar Aug 14 '15 16:08 brandonbird

This is a much better fix, I will delete my PR.

harrypritchett avatar Aug 19 '15 22:08 harrypritchett

Are there any outstanding issues that are stopping this from being merged @brandonbird @cornflourblue ?

drewfreyling avatar Nov 25 '15 03:11 drewfreyling

@drewfreyling I haven't seen anything from @cornflourblue.

brandonbird avatar Nov 26 '15 23:11 brandonbird

@cornflourblue what is that status of this?

drewfreyling avatar Apr 21 '16 05:04 drewfreyling

@cornflourblue this appears to be ready for merge, what is the hold up?

dennismi avatar May 06 '16 09:05 dennismi

@cornflourblue is this project no longer active?

drewfreyling avatar Apr 27 '17 00:04 drewfreyling

I guess it isn't.

drewfreyling avatar Nov 22 '19 20:11 drewfreyling