Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure fixed element container #89

Open
althaus opened this issue Dec 14, 2016 · 2 comments
Open

Allow to configure fixed element container #89

althaus opened this issue Dec 14, 2016 · 2 comments

Comments

@althaus
Copy link
Contributor

althaus commented Dec 14, 2016

We've got still some issues with form and FixedHeader/Footer (#68). Wouldn't it be sufficient to make the container configurable? At the moment the floating footer get's appended to body. If we'd move it out of the table into the surrounding form it'll still work out-of-the-box:

Before DT triggers:

<body>
    <form>
        <table>
            <tbody><!-- some rows --></tbody>
            <tfoot><!-- some actions --></tfoot>
        </table>
    </form>
</body>

Current version:

<body>
    <form>
        <table>
            <tbody><!-- some rows --></tbody>
        </table>
    </form>
    <table>
        <tfoot><!-- some actions --></tfoot>
    </table>
</body>

Alternate solution:

<body>
    <form>
        <table>
            <tbody><!-- some rows --></tbody>
        </table>
        <table>
            <tfoot><!-- some actions --></tfoot>
        </table>
    </form>
</body>

https://github.com/DataTables/FixedHeader/blob/master/js/dataTables.fixedHeader.js#L285

Cheers
Matthias

@DataTables
Copy link
Collaborator

For the most part the position of the fixed element in the DOM doesn't actually matter (since it is position: fixed). However, at the transition point when the table gets to the top of the page and the header has to scroll off, it needs to be position: absolute for that to work. At that point the positioning in the DOM is important. I used body because it simplifies things a lot. It probably would be possible to put it in next to the DataTable itself using the correct offset parent.

If that is implemented it would be easier to just make that the method used rather than providing an option for the container.

@althaus
Copy link
Contributor Author

althaus commented Dec 15, 2016

I'd be fine with that. Dunno if someone needs to rely on the body-placement and changing the DOM position would be a BC break now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant