As previously announced via banners and our newsletters, support is no longer available through this platform.

For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.

You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.

Paid customers: Please log in to your store account for support.

Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com

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,576
    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