I created this as I needed to customize my interface that works on both Desktop & Mobile without display issues plus I could not change the label of the ADD Master/Detail button.
I used CSS + PHP instead of JQUERY+PHP. While Jquery works as well, it has the limitation of being executed AFTER the DOM is loaded i.e. the objects will be rendered before they are hidden, which looks off especially if the production environment isn't fast.
**NOTE*** THIS METHOD ALSO HIDES THE BUTTONS IN DETAIL TABLES OF MASTER DETAIL FORMS, EXCEPT THE ADDROW BUTTON*********
Requirements:
Friconix ICON pack(Optional)
In PHP -> Page Options settings, uncheck 'Use button dropdowns for links' & 'Use button dropdown in paging section'
METHOD.
1a. Go to HTML->Styles->User and add the following:
/*MOVE MASTER/DETAIL EDIT.COPY,DELETE BUTTONS OUT OF VIEW PORT*/
a.btn.btn-default.ew-detail-add-group.ew-detail-add,th.ew-list-option-header.text-nowrap, td.ew-list-option-body.text-nowrap{
position: absolute;
top: -9999px;
left: -9999px;
}
1b. Go to Client Scripts -> Table-Specific -> List-Page -> Startup_Script and add:
$(document).ready(function() {
// HIDE MASTER DETAIL ADD OR ANY ADD LINKS
$('a.btn.btn-default.ew-detail-add-group.ew-detail-add').hide();
$("th.ew-list-option-header.text-nowrap").hide();
$("td.ew-list-option-body.text-nowrap").hide();/
});
1b. (Optional)Link to friconix icons by going to Server Events -> Global -> All_pages and add script link
Go to Server-Events -> Table-Specific -> List-Page -> ListOptions_Load and add the following to create your link. In this example, a master/detail edit link
$opt = &$this->ListOptions->Add("my_edit"); //
$opt->OnLeft = TRUE; // Link on leftGo to Server-Events -> Table-Specific -> List-Page -> ListOptions_Rendered and add logic for the link. In this example, a master/detail edit link
$this->ListOptions->Items["my_edit"]->Body = "<a href='myheader_headeredit.php?showdetail=mydetail_lines&id=".urlencode($this->id->CurrentValue)."'><i
class='fi-cwsux2-pen'></i> </a>";To add a master/detail add button, go to Server-Events -> Table-Specific -> List-Page -> Page_Render and add the following code:
//CUSTOM MASTER DETAIL ADD BUTTON
$this->OtherOptions["addedit"]->UseDropDownButton = FALSE;
$this->OtherOptions["addedit"]->ShowInButtonGroup = FALSE;
$options = &$this->OtherOptions;
$option = $options["action"];
$item = &$option->Add("myadd_link");
$item->Body = "<a class=\"ewAction btn btn-success\" href=\"myheader_headeradd.php?showdetail=my_details_lines\"><i class=\"fi-cwsup2-plus-solid\" data-caption=\"Create My Details\"></i>Create My Details</a>";
$item->Visible = TRUE;