Foundation 6 Reveal & DataTables Pagination

Foundation 6 Reveal & DataTables Pagination

LiamFordLiamFord Posts: 2Questions: 1Answers: 0

Hi All,

I've been trying to get a DataTable to work inside a Foundation 6 Reveal modal, but whenever I click on a pagination button it closes the modal.

If you open the modal back up, you can see that it has changed the page, but how do I prevent it from closing the modal?

Here is a JS fiddle demonstrating this: https://jsfiddle.net/Lts99vL1/

Many thanks for any ideas.

Answers

  • LiamFordLiamFord Posts: 2Questions: 1Answers: 0

    I managed to solve this issue by setting an option on the Reveal modal, data-close-on-click = "false".

    Thanks for a great add-on, been using it for a few years across various apps, & frameworks and always impresses me :smile:

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Hi,

    Thanks for posting back with your solution. Fantastic to hear that you've got this working. Interesting that the Zurb folks make that behaviour opt out rather than opt in, but either way at least that option is available and you found it! I'm sure others will find your post useful!

    Regards,
    Allan

  • renderwsrriorrenderwsrrior Posts: 1Questions: 0Answers: 0

    I'm trying too to use datatables and f6 reveal. In my case, using the pagination (so switching from page 1 to 2) breaks the reveal.
    I'm using Ajax to pass dynamic data to the reveal. Everything works on the first page, but paginating breaks the modal (it opens the page requested via ajax not in the modal, but in the main browser window)
    There's something I've to set within the datatable settings?

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    My guess is that you are running into this FAQ:

    but without a test page it is difficult to say for sure.

    Allan

This discussion has been closed.