Page 1 of 1

Master Detail Second Tab Hide Element

Posted: Tue Mar 21, 2017 1:08 am
by johnberman

I have a master \ detail table setup

Im using the DetailPreview extension

Anyway when I click the plus sign to expand the the master and show the records within they are listed as expected and under that table there is the record count and a button

Master / Detail View

I have hidden this based on advice from the forum by putting this code

$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

in Client Scripts \ List Page \ Client Script

I have now added a second details link and on that tab I have

Master / Detail View - which I want to hide

So if I insepct the element I have

<button type="button" class="btn btn-default btn-sm" title="" onclick="window.location='boamlist.php?showmaster=duration_lookup&fk_match_id=20'" data-original-title="Possible BOAM Capture"><span data-phrase="MasterDetailListLink" class="icon-table ewIcon" data-caption="Detail List" style="display: none;"></span></button>

so how can I added a version of this

$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

in Client Scripts \ List Page \ Client Script

that will effect the second tab ?

Regards

John B


Re: Master Detail Second Tab Hide Element

Posted: Tue Mar 21, 2017 10:04 am
by mobhar

The button code you posted above is not for the tab. You need to inspect the actual code that related to the tab. Then, hide the tab based on its element id and/or based on you needs.


Re: Master Detail Second Tab Hide Element

Posted: Tue Mar 21, 2017 1:41 pm
by johnberman

sorry just not getting this but I assume I need something like this

Client Scripts \ List Page \ Client Script

// hides hides the the button on first tab
$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
})
// code similar will hide the on the second tab but I need to add the element ID (once I find it )
$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

John B


Re: Master Detail Second Tab Hide Element

Posted: Wed Mar 22, 2017 1:12 pm
by johnberman

I dont know much about elements but after some reading I think this line is the one im interested it

<a href="#" data-toggle="tab" data-table="boam" data-url="boampreview.php?t=
duration_lookup&f=MjEf7T0J582OG1Pp4Z9-_Q.." data-target="#139553" aria-expanded="true" class="">Possible BOAM Capture</a>

and this is the element ID: data-table="boam"

If I remove the above line the tab is gone, so if Im right I need to add data-table="boam" to

$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

?

Regards
John B


Re: Master Detail Second Tab Hide Element

Posted: Wed Mar 22, 2017 1:49 pm
by mobhar

$(document).ready(function() {
$('[data-table="boam"]').hide();
});


Re: Master Detail Second Tab Hide Element

Posted: Thu Mar 23, 2017 1:36 am
by johnberman

Sorry not quite

I dont want to hide the second tab but remove the group details button thats underneath the record count

on the master lookup page in Client Scripts \ List Page \ Client Script I have

$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

so I need a statement to do the same but for the second tab, so tried this but it does not seem to achieve the effect.

$(document).ready(function() {
$('[data-table="boam"]','[data-phrase="MasterDetailListLink"]').hide();
});

Pointers appreciated

Regards
John B


Re: Master Detail Second Tab Hide Element

Posted: Thu Mar 23, 2017 10:00 am
by mobhar

When you put this following code:

$(document).ready(function() {
$('[data-phrase="MasterDetailListLink"]').hide();
});

in "Startup Script" of "List Page" that belongs to your master table, then it will hide all the "Master/Detail List" links in all of your detail tables, because all of those links are using the same data-phrase, which is "MasterDetailListLink".