light gallery feature disappears after using search, sort and next page in datatable

light gallery feature disappears after using search, sort and next page in datatable

ThomasMNThomasMN Posts: 4Questions: 1Answers: 1

Hi guys, I've recently dabbled in implementing a datatable into my website. (this is the first website I've ever worked on, so it's a template I've bought and redesigned.)
So I have recently made a table with a lot of 'disciplines' from a game called Crowfall.
It can be seen here: https://vanguardcrowfall.com/disciplines

My problem is, if you try and click on the images in the table, the images on the first page will pop up and show up like in the light gallery as they should.

But if you use the sort function, search function or go to next page in the table, the pictures from clicking on the icons, won't act as if they were in the light gallery.

And I would like all the icons to work like they work on the first page of the table.

Hoping someone could help with this.

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 20,145Questions: 26Answers: 4,736
    Answer ✓

    The website is wanting to update my certs so a cancelled entering it. Start with this FAQ regarding events not working on other pages. Along with that you will probably want to read about `jQuery event delegation. And finally take a look at this example:
    https://datatables.net/examples/advanced_init/events_live.html

    Kevin

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    I just took a look, and it seems to be behaving as expected. If this isn't the case, can you give step-by-step instructions on how to reproduce, please.

    Colin

  • ThomasMNThomasMN Posts: 4Questions: 1Answers: 1

    @colin Thanks for taking a look, yes I'll make a step-by-step.

    If you forexample search for "Plaguelord", and click on the icon for plaguelord, you will see it pops up as a part of a gallery, so there's and x you can close the window with in the top right.

    If you instead search for "Poisoner", and click on the icon for Poisoner, you will see it opens up a whole new window, and you need to click back to get back to the table.

    The problem is, every icon should act like when I press on plaguelord, because it's exactly the same code, that I have been copy pasting.

    But it's only the 10 first shown entries that works properly, when I try show more entries that doesn't work either.

  • ThomasMNThomasMN Posts: 4Questions: 1Answers: 1

    @kthorngren thank you, I will take a look at your links.
    Regarding the certs I don't know, is it SSL you are referring to? In that case it has just been set up with a brand new certificate.

  • ThomasMNThomasMN Posts: 4Questions: 1Answers: 1
    Answer ✓

    So my friend fixed it for me through a custom js file, where forced the click action to always use the lightgallery feature instead of the link part.

This discussion has been closed.