This topic is locked

Hide buttons on details records

5/17/2020 12:41:27 PM
PHPRunner General questions
W
WilliamB authorDevClub member

Hello,
I am trying to hide buttons (both custom and built in) on the details view of the master list page.
Does anyone know how to do this?
Thanks,

Billy

C
copper21 5/18/2020

Go to the fields you want to hide on the designer page. Click on the field and look to the right of the screen where you will see "item id". Click on the question mark just to the right and it explains how to hide elements.

W
WilliamB authorDevClub member 5/18/2020



Go to the fields you want to hide on the designer page. Click on the field and look to the right of the screen where you will see "item id". Click on the question mark just to the right and it explains how to hide elements.


Hello Brian21,
Yes I have tried using those given instructions. That does not work. I will try to explain better.
I have a main transactions list page that shows details of Case Notes, Payments and such. See image below. I want to hide the buttons that are visible on the detail records but on the parent list page only. Those examples work fine if I want to hide the button on the specific details list pages but that is not what I want.
I can't get the img to load in here but this is the url.

https://imgur.com/q6VyyWh

C
copper21 5/18/2020



Hello Brian21,
Yes I have tried using those given instructions. That does not work. I will try to explain better.
I have a main transactions list page that shows details of Case Notes, Payments and such. See image below. I want to hide the buttons that are visible on the detail records but on the parent list page only. Those examples work fine if I want to hide the button on the specific details list pages but that is not what I want.
I can't get the img to load in here but this is the url.

https://imgur.com/q6VyyWh


Ok, I think I got you. There may be an easier way than this, but what I do for that is to make a "Custom View" of the child table in the "Tables" view. I then attach the parent record to that new custom view child record and then you can change the list view for the child record by taking the buttons away.
The downside to this is that if you add, edit, or delete any events you have to do it to both tables/views to keep them the same.

W
WilliamB authorDevClub member 5/18/2020



Ok, I think I got you. There may be an easier way than this, but what I do for that is to make a "Custom View" of the child table in the "Tables" view. I then attach the parent record to that new custom view child record and then you can change the list view for the child record by taking the buttons away.
The downside to this is that if you add, edit, or delete any events you have to do it to both tables/views to keep them the same.


Ya, I want to stay away from that if possible. I will keep searching for a hide button solution.
Thanks

need2sleepDevClub member 5/19/2020

This is similar to what I was asking for. Thanks to @mbintex from my topic and also his topic

This code has to go onto each list table that is linked as a child table in the "BeforeDisplay"

$master = $pageObject->getMasterRecord();
if ( $master != Null or $master !="" )

{

$pageObject->hideItem("delete");

$pageObject->hideItem("add");

//code to hide buttons

}
W
wpl 5/19/2020



Ya, I want to stay away from that if possible. I will keep searching for a hide button solution.
Thanks


Billy,
maybe you can give this a try. In event "BeforeDisplay" of the list page that will be the detail:



global $strTableName;
$pageObject->setProxyValue("isDetail", isset($_SESSION[$strTableName . "_masterkey1"]));


And, in JavaScript "OnPageLoad" of this page:



if(proxy.isDetail)

{

var ctrlAdd = $('#addButton'+pageid);

ctrlAdd.hide();



var ctrlDel = $('#delete_selected'+pageid);

ctrlDel.hide();

}


Regards

W
WilliamB authorDevClub member 5/19/2020



This is similar to what I was asking for. Thanks to @mbintex from my topic and also his topic

This code has to go onto each list table that is linked as a child table in the "BeforeDisplay"

$master = $pageObject->getMasterRecord();
if ( $master != Null or $master !="" )

{

$pageObject->hideItem("delete");

$pageObject->hideItem("add");

//code to hide buttons

}



This works but I also have the detail on that master record edit page. It removes buttons there as well and I only want them removed on the master list page.
Thanks

W
WilliamB authorDevClub member 5/19/2020

I got this working.
I added this to the details list page "Before display".

if ($_SESSION["hideButtons"] == 1){

$pageObject->hideItem("inline_add");

$pageObject->hideItem("delete");

}


I added this to the master list page "Before display".

$_SESSION["hideButtons"] = 1;


I added this to the master edit page "Before process".

$_SESSION["hideButtons"] = "";


I'm not sure if there is a better way but it works.
Billy

need2sleepDevClub member 5/19/2020



I got this working.
I added this to the details list page "Before display".

if ($_SESSION["hideButtons"] == 1){

$pageObject->hideItem("inline_add");

$pageObject->hideItem("delete");

}


I added this to the master list page "Before display".

$_SESSION["hideButtons"] = 1;


I added this to the master edit page "Before process".

$_SESSION["hideButtons"] = "";


I'm not sure if there is a better way but it works.
Billy


Try this way:
https://xlinesoft.com/phprunner/docs/getdetailspage(name_recordid).htm

W
WilliamB authorDevClub member 5/19/2020



Try this way:
https://xlinesoft.com/phprunner/docs/getdetailspage(name_recordid).htm


That is what I was looking for but can't seem to get it to work. I will need to stick with what I have for now. Does anyone have a working example of this?
Billy