Activating colorbox again after using the search filter in the table

Activating colorbox again after using the search filter in the table

PieterSparkPieterSpark Posts: 3Questions: 1Answers: 0

I'm using the basic config of datatables but when using the search filter on top, colorbox doesn't work anymore... so the popup just opens in a new page.
How or where can I reactivate the $(".colorbox").colorbox(); ? Any ideas?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    This FAQ might help you understand why it isn't working.

    More generally use rows().node() to get all tr elements in the table and then you can run your selector and apply colorbox to them.

    Allan

  • PieterSparkPieterSpark Posts: 3Questions: 1Answers: 0

    Ok, that's already a good start. Now where do I find the code for when the searchfilter is used? I need to know which function to extend.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    What "searchfilter"? Do you mean the global search box? In what way do you want to extend it and to do what?

    Allan

  • PieterSparkPieterSpark Posts: 3Questions: 1Answers: 0

    I would like colorbox to still work once I used th search box on top of the table.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I've already said how to do that - use rows().nodes() and then apply a selector to them.

    $(".colorbox", table.rows().nodes()).colorbox();
    

    If you provide a link to a test case showing the issue (as required in the forum rules) I'd be able to be more specific.

    Allan

Sign In or Register to comment.