v9.2
I would like to disable the edit link for rows that satisfy a condition
v9.2
I would like to disable the edit link for rows that satisfy a condition
acutri wrote:
my solution:
function ListOptions_Rendered() {
// Example:
if ($this-><DBFIELD>->CurrentValue == <MYVALUE>) {
$this->ListOptions->Items["edit"]->Body = "";
}
}
thank !!
Hello. I am in the list page.
I try to use this statement : $this-><DBFIELD>->CurrentValue
I need It to put in a link to open a custom page like <a href="test.php?id=\"".$this->id->CurrentValue."\">
but the id value is missing. I have put this code into ListOptions_Rendered event.
Do where I'm wrong ?
Thanks.
Max
eudosia wrote:
$this->id->CurrentValue
If you put this into ListOptions_Rendered server event, there will have value (if id is your ID field)
eudosia wrote:
<a href="test.php?id=\"".$this->id->CurrentValue."\">
Also, just a quick glance, your syntax for href need to correct assume this is what you need to put into body of edit link:
"<a href=\"test.php?id=" . $this->id->CurrentValue . "\"></a>";
Anyway, can you post your complete code so that it is easy for discussion.
Thanks so much danielc.
My syntax was wrong...so the link was truncated.....but I fallen in error thanks to the phpmaker editor syntax highlight that tell me my syntax was right.
Now I have correct:
function ListOptions_Rendered() {
// Example:
$this->ListOptions->Items["stampa"]->CssStyle="text-align:center;";
$this->ListOptions->Items["stampa"]->Body = "<a href=\"test.php?id=" . $this->id->CurrentValue . "\" class=\"btn btn-small ewRowLink ewDetailList\">Stampa</a>";
}
but in this case the syntax here $this->ListOptions->Items["stampa"]->Body = "<a href=\"test.php?id=" . $this->id->CurrentValue . "\" class=\"btn btn-small ewRowLink ewDetailList\">Stampa</a>";
appears not correct in the phpmaker10 editor.
THanks so much to point me the mistake.
Max.
Just to clarify for anyone else, this worked for me in the List page - place under table-specific.
I have a column called Status which has either active or inactive in it and I wanted to hide the edit icon if inactive:
// ListOptions Rendered event
function ListOptions_Rendered() {
if ($this->Status->CurrentValue == "inactive") {
$this->ListOptions->Items["edit"]->Body = "False";
}
}