Okay
  Public Ticket #2467717
Customize the popup page to show my request response
Closed

Comments

  • Pulego Tech started the conversation

    Good Day

    I need your help to advice if it will be possible to customize the popup since i need to add a javascript code that i have to make a request based on the id so i can get more data and display on the popup?

    Or maybe to add a shortcode to pull the info i need..

    if possible i need the location of the  popup page that i can work on to customize the popup and how it looks at the moment.


    Thanks

  •  2,572
    Aleksandar replied

    Hello Pulego Tech

    The data is being sent with the POST method, so you can use WordPress' hook the_content, where the data can be taken be taken from the POST and forwarded to do_shortcode function. There, our shortcode can be placed with the placeholder %VAR1% like in the following example. Of course, you first need to create an SQL Query based table, where you'll filter the desired column with %VAR1%. Here's the example:

    function test($content){
     if (isset($_POST['wdt_details_data'])){
     $detailsData= json_decode(stripslashes($_POST['wdt_details_data']), true);
     } $content .= do_shortcode('[wpdatatable id=1 var1=' . $detailsData['columnName'] . ']');
    return $content;
    }
    add_filter( 'the_content', 'test');

    The data of an entire row you clicked on are located in $_POST['wdt_details_data']. The format is that of an array of the pairs the row contains (columnName=value), where 1 is the ID of the table on the Master page, and it needs to replace the columnName with orig header of the column you wish to filter.

    This will be added to every page, so you need to add another condition above everything for the posts you need. 

    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