Page 1 of 1

Change the Edit link

Posted: Fri May 17, 2019 2:43 am
by Bishu

Change the default the edit link of href.
normally the default edit lint is - tableedit.php
and i would like to change to another link.
edit->href = "table2.php"


Re: Change the Edit link

Posted: Fri May 17, 2019 4:28 am
by sangnandar

The tablename for Edit Link is hardcoded.
See function GetEditUrl() in table-info.php

So the only way you can change tablename is during,
ListOptions_Rendered(){
// copy Edit link from page HTML
// change the tablename
$this->ListOptions->Items["edit"]->Body = ...yourEditedLink... ;
}

A more elegant solution would be to use php str_replace(), such as:
$body = $this->ListOptions->Items["edit"]->Body ; // get initial Edit link
$body = str_replace(...) ; // find old-tablename and replace with new-tablename
$this->ListOptions->Items["edit"]->Body = $body ;