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

fix-head calculates invalid header width, only fixes upon clicking header

Open Syntaf opened this issue 7 years ago • 6 comments

I'm trying to use fixed-table-header in conjunction with a couple other modules, but it seems fix-head calculates it's header width well before the other elements kick in. If I click on anything else within the page, fix-head moves into the correct position

Is there anyway to force-refresh the fix-head header calculation at the end of a controller?

Syntaf avatar Jul 30 '16 21:07 Syntaf

I am also facing the same Issue, after the table load the header cell is moved to reposition.

ghost avatar Sep 21 '16 10:09 ghost

@Syntaf i am get some issue and i added next code for recalculating headers cells width:

$timeout () -> window.dispatchEvent(new Event('resize')) , 0

it trigger resize event for window and call recalc method form lib. It is terrible, but works

zhukovRoman avatar Nov 22 '16 08:11 zhukovRoman

@zhukovRoman Awesome!

Syntaf avatar Nov 22 '16 20:11 Syntaf

@Syntaf i am get some issue and i add next code for recalculating headers cells width:

$timeout () -> window.dispatchEvent(new Event('resize')) , 0

it trigger resize event for window and call recalc method form lib. It is terrible, but works.

Roman, can you please provide more details, how this method can be used. Your code should be in controller or fixed-table-header.min.js

UPD $timeout(function() { $window.dispatchEvent(new Event("resize")); }, 100); in controller did the trick

zhenya2224 avatar Feb 02 '17 10:02 zhenya2224

@zhenya2224 You are right! In my case, I call $timeout () -> window.dispatchEvent(new Event('resize')) , 0 in controller method, which is toggle some block on the page.

You can use 0 delay $timeout (only Angular timeout with $), because it was call after repainting.

zhukovRoman avatar Feb 02 '17 19:02 zhukovRoman

Roman, I would be grateful for advice or solution, the problem is the header blinks while implementing $timeout(function() { $window.dispatchEvent(new Event("resize")); }, 100);

I made the value 0, it made it worse, it takes more time to recalculate resize event. timeout 100 works, but it creates blinking when page loads.

zhenya2224 avatar Mar 13 '17 18:03 zhenya2224