trying to hide details/edit/add on preview object

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sticcino
User
Posts: 1043

trying to hide details/edit/add on preview object

Post by sticcino »

Hi,

trying to hide the "xxxx details" , "master/detail view", "master/detail edit" buttons that appear on the preview window("+") ..

has this changed?, not seeing the items in the: $this->OtherOptions['xxxx']->Items[xxxx] object

was able to hide in v10 with php, do we need to use jquery
I am able to hide the "+ add record" button with:
$this->OtherOptions['addedit']->Items['add']->Visible = false;

but that's about it.

Thanks,
Johnny


sticcino
User
Posts: 1043

Post by sticcino »

i found in:
RenderListOptionsExt()

// $btngrp .= "<button type=\"button\" class=\"btn btn-default btn-sm\" title=\"" . $Language->TablePhrase("wo_det", "TblCaption") . "\" onclick=\"window.location='" . $detaillnk . "'\">" . $Language->Phrase("MasterDetailListLink") . "</button>";
}
// if ($GLOBALS["wo_det_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'wo_det'))
// $btngrp .= "<button type=\"button\" class=\"btn btn-default btn-sm\" title=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" onclick=\"window.location='" . $this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=wo_det") . "'\">" . $Language->Phrase("MasterDetailViewLink") . "</button>";
// if ($GLOBALS["wo_det_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'wo_det'))
// $btngrp .= "<button type=\"button\" class=\"btn btn-default btn-sm\" title=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" onclick=\"window.location='" . $this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=wo_det") . "'\">" . $Language->Phrase("MasterDetailEditLink") . "</button>";

if REM's out the code above, and now the options are hidden, but this is in the "live" code, so a re-generate will overwrite it, is there some where I can hide these 3 options and still save the changes if I have to re-generate the code.

thanks,
Johnny


danielc
User
Posts: 1601

Post by danielc »

If you want to hide the buttons that appear on the preview window("+"), the simplest is to apply user style to hide it (see HTML Settings in help file). View HTML source and find the related element ID (for example, <div data-table="... " ... </div>).

div[data-table="detailtablename"] {
display: none;
}


sticcino
User
Posts: 1043

Post by sticcino »

excellent, thanks!

Johnny


Post Reply