row can't deleting

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

row can't deleting

Post by GT73 »

I have enabled the delete button for specific users, but I would like to prevent them from deleting the first few lines of the table, which event can I use, ListPage-> PageLoad or Render? and how can I implement the code, this->?, some examples?


GT73
User
Posts: 415

Post by GT73 »

I used the body, visible moves the lines

function ListOptions_Rendered() {
// Example:
//$this->ListOptions->Items["new"]->Body = "xxx";
$id = $this->MyField->CurrentValue;
if($id == 1 | $id == 2){
$this->ListOptions->Items['delete']->Body = "";
}
}


mobhar
User
Posts: 11726

Post by mobhar »

GT73 wrote:
if($id == 1 | $id == 2){

Double check again that code above. Shouldn't it be like the following one below?

if ($id == 1 || $id == 2) {

or

if ($id == "1" || $id == "2") {


GT73
User
Posts: 415

Post by GT73 »

mobhar wrote:
if ($id == "1" || $id == "2") {
I was wrong to type... ;)


Post Reply