FixedHeader issue on Blazor

FixedHeader issue on Blazor

mobinsevenmobinseven Posts: 4Questions: 1Answers: 0

Hi. I'm using DataTables(+Responsive+FixedHeader) with Blazor. There is only one problem with FixedHeader package. It won't stick to top until a user interaction with table triggers table to rerender; like expanding/collapsing the row details(Responsive feature). Any ideas will be welcome.

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • mobinsevenmobinseven Posts: 4Questions: 1Answers: 0

    Hi Colin. Here is the page showing the case.

  • mobinsevenmobinseven Posts: 4Questions: 1Answers: 0
    edited January 2020

    I've found a workaround for this issue:

    registered a mousewheel event for the table and call adjust() in it:

    $('.table').bind('mousewheel', function (e) {
            table.fixedHeader.adjust();
        });
    

    But it would be great if we weren't forced to do so.
    Also this won't work for mobile browser as there is no 'wheel'. So I should use libraries like hammer.js, etc.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Hi,

    I'm afraid the demo page isn't loading for me at the moment. Are you able to recreate it using http://live.datatables.net or JSFiddle please? I agree, any extra code shouldn't be required, so I'd like to understand what is going wrong.

    Thanks,
    Allan

  • mobinsevenmobinseven Posts: 4Questions: 1Answers: 0

    Hi Allan,

    The problem was caused by drawer element of MatBlazor which I used as container of the table. Outside of it, there was no problem. So I should register scroll event for that container and adjust() the table in it.

    p.s: Sorry if I can't provide a running example because Blazor needs a server.

    Thanks for following,
    Mobin

This discussion has been closed.