Is there an event for fixedHeader.adjust()?

Is there an event for fixedHeader.adjust()?

in_opin_op Posts: 1Questions: 1Answers: 0

I have an interesting problem. I have a page with multiple tables that use fixedHeaders. After initial load, each table fetches extra data for each row asynchronously which sometimes causes the row to expand in size, which causes the fixedHeader locations to get out of sync. DataTables provides fixedHeader.adjust() which corrects this problem. However, one of my column headers is a radio select of two options, and on fixedHeader.adjust() the selection is actually removed (both on the original and the fixed header). I keep track of its value and set it back correctly, but the issue is that fixedHeader.adjust() occurs asynchronously, so I can't simply reset it on the next line of code after the adjust call. Currently, I'm using a 1ms setTimeout, which works, but creates some visual jank as it creates a split second where the radio button appears with no selection. Because multiple tables are updating concurrently, this visual jank happens every few seconds and is pretty jarring.

So my question is whether there is an event I can hook into so I can reset the radio button immediately after fixedHeader.adjust() is called, which I hope would reduce this jank by minimizing the time between the adjust clearing the selection and me re-imposing the selection. If there is no event, my more generic question is for some other clever solution to this visual jank.

Thanks.

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    There isn't I'm afraid. Could you give me a link to a page showing the issue so I can take a look and see what is going on?

    Thanks,
    Allan

Sign In or Register to comment.