Okay
  Public Ticket #2486202
Open in same window
Closed

Comments

  •  1
    Gene Crawford started the conversation

    I'd like to have the " Master-detail" link open in the same browser window and not a new window when i click on the details link. How do i go about doing that? 

  •  2,498
    Aleksandar replied

    Hello Gene

    Unfortunately there is not built in option at the moment, but we will add it in one of the next updates.

    You can change it in code in file wp-content/plugins/wdt-master-detail/class.masterdetail.wpdatacolumn.php around line 51 you will find this

    $formattedValue = "<form class="wdt_md_form" method="post" target="_blank" action="{$renderAction}"></form>

    and you have to change target="blank" to target="_self"

    $formattedValue = "<form class="wdt_md_form" method="post" target="_self" action="{$renderAction}"></form>

    also in same file on line 64 you will find this

    $formattedValue = "<form class='wdt_md_form' method='post' target='_blank' action='{$renderAction}'>

    and you have to replace with this

    $formattedValue = "<form class='wdt_md_form' method='post' target='_self' action='{$renderAction}'>

    Then go to wp-content/plugins/wdt-master-detail/templates/md_modal.inc.php and change line 52 just like you did the others, so instead of:

    <form class="wdt_md_form" method="post" target="_blank" action="<?php echo $renderAction; ?>"></form>

    Change it to this:

    <form class="wdt_md_form" method="post" target="_self" action="<?php echo $renderAction; ?>"></form>

    That one's for row click.


    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

  • Tim replied

    FWIW you could fix all new window clicks by adding this to the head

    <base target="_self">

    However, a better option would be to target the form with a jquery override and not modify the core code if the devs won't add this a toggle feature:

    jQuery(document).ready(function($){
        $('.wdt_md_form').attr('target','_self');
    });