Is there a way to make teh default edit link on a list page go to the master detail edit page rather than the normal edit page?
Make default edit link master / detail
-
- User
- Posts: 32
Sometrhing like
$this->ListOptions->Items["Edit"]->Link = "<a href='bllah.php>blah</a>'";
Help file doesnt provide much help for this
-
- User
- Posts: 32
Yep did that, here is what i had for anyone else trying to do this
$this->ListOptions->Items["edit"]->Body = "<a class=\"ewRowLink ewEdit\" title=\"\" data-caption=\"Edit\" href=\"assets_with_actions_lat_longedit.php?showdetail=tblDefectDoc&DefectID=" . $this->DefectID->ListViewValue() . "&ActionID=" . $this->ActionID->ListViewValue() . "\" data-original-title=\"Edit\"><span data-phrase=\"EditLink\" class=\"icon-edit ewIcon\" data-caption=\"Edit\"></span></a>";
-
- User
- Posts: 642
What other are saying seems straight forward to me as whats important is to create a hyperlink which links to the particular master page and shows the relevant detail pages .where the href="masteredit.php?id=id&showdetail=detail_1,detail_2"
BUT if you prefer to overide the edit link itself then There is an easier way to this.
You will notice that the difference between an edit,view link and a master detail edit link and view link is the url parameter of "showdetail" and by default it looks like "showdetail=", so all you have to do is replace it with "showdetail=detail_1,detail_2" etc separated by commas. You can even assign this to another list option
function ListOptions_Rendered() {
// Example:
//$this->ListOptions->Items["new"]->Body = "xxx";
//add detail links on edit link
$this->ListOptions->Items["edit"]->Body = str_replace("showdetail=","showdetail=detail_1,detail_2",$this->ListOptions->Items["edit"]->Body);
$this->ListOptions->Items["view"]->Body = str_replace("showdetail=","showdetail=detail_1,detail_2",$this->ListOptions->Items["view"]->Body);
}
NOTE:The only downside to this is whenever you add more details you have to add them to the commas list