Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3544726
Customizing issues
Closed

Comments

  • Faraz started the conversation

    Hi,

    I'm trying to display the Filters in a pop up instead of above the table.

    I'm doing it in the following way: Custom CSS, javascript on the page, and html structure in the functions.php. But it doesn't work. Can you help me with it?

    The code is below.

    CSS 

    /* Style for the Popup */
    #filterPopup {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 1; /* Sit on top */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgb(0,0,0); /* Fallback color */
        background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }

    /* Popup Content */
    .filter-popup-content {
        background-color: #fefefe;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
    }

    /* Close Button */
    .close {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
    }

    .close:hover,
    .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }

    /* Style for the Button to open the popup */
    #filterButton {
        background-color: #4CAF50;
        color: white;
        padding: 10px 20px;
        margin: 10px 0;
        border: none;
        cursor: pointer;
    }

    #filterButton:hover {
        background-color: #45a049;
    }

    /* Show the popup when the 'show' class is added */
    #filterPopup.show {
        display: block;
    }

    JS

    <script>

    document.addEventListener('DOMContentLoaded', function() {
        var filterButton = document.getElementById('filterButton');
        var filterPopup = document.getElementById('filterPopup');
        var closeButton = document.getElementsByClassName('close')[0];

        filterButton.onclick = function() {
            filterPopup.classList.add('show');
        }

        closeButton.onclick = function() {
            filterPopup.classList.remove('show');
        }
    });

    </script>

    HTML structure in functions.php

    function add_my_custom_popup() {
        ?>
        <!-- Button to open the popup -->
        <button id="filterButton">Open Filters</button>

        <!-- The Popup -->
        <div id="filterPopup" class="filter-popup">
            <div class="filter-popup-content">
                <span class="close">×</span>

            </div>
        </div>
        <?php
    }
    add_action('wp_footer', 'add_my_custom_popup');


    Your thoughts and input would be be much appreciated.

  •  2,498
    Aleksandar replied

    Hello Faraz.

    We already have this functionality included in the plugin:

    8836335642.png

    You can use that freely.

    Custom code is not included in the provided support for the plugin, so we can't help you with that.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables