Open Syntaf opened 7 years ago
I am also facing the same Issue, after the table load the header cell is moved to reposition.
@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 Awesome!
@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 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.
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.
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?