• Resolved pawellabaj

    (@pawellabaj)


    I have created page to show the problem – https://www.foto.labaj.com.pl/photonic-datatables-issue/

    Page contains simple dynamic page with “name” and “image” columns. Clicking on thumbnail in second one opens lightbox with a big picture.

    Reproducing the strange behaviour:

    1. After page’s loading, everything is fine.
    2. Sort the table to reverse the order
    3. Now when duck’s thumbnail is clicked, owl’s picture is opened and vice versa.
    4. Sort table to the original order and everything works fine again.

    I’ve checked for a page’s source and it looks fine.

    Dynamic table is generated with https://tablepress.org/

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    Simply put, this is not supposed to work. If you are changing the sort order of photos generated by Photonic, you will have to figure out how to reinitialize Photonic again – there is no way for Photonic to know that you have used some other plugin to change photo sequence markup.

    Every lightbox script is initialized when a page is loaded (regardless of whether you are using Photonic or something else) – images are bound to the lightbox script in a particular sequence. When you are sorting using DataTables, you are physically changing the page markup after the lightbox has already been initialized. What you are attempting to do is called “dynamic binding” – you are expecting the code to understand something that an unrelated plugin has done to the page. That is not possible for any code to predict. Even within Photonic, to develop features like “More Photos”, I have to write extra code to handle dynamic binding.

    To do what you are asking, you will have to write quite a bit of JavaScript; it is not going to be built as a part of Photonic.

    Thread Starter pawellabaj

    (@pawellabaj)

    Thank you @sayontan for the explanation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘lightbox in DataTables doesn’t work properly’ is closed to new replies.