Hide Delete buttons on List page

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

Hide Delete buttons on List page

Post by sangnandar »

I'm following this (for View page) :
http://www.hkvforums.com/viewtopic.php?f=4&t=34158
It works ok on both server and client.

I try the same for List page.

Server Events
Error messages:
Warning: Creating default object from empty value in C:\..\(filename)list.php on line 2409
codeline 2409: $this->OtherOptions["action"]->Items["delete"]->Body = "";
Notice: Undefined property: stdClass::$Name in C:\..\phpfn13.php on line 2685
codeline 2685: if ($item->Name <> $this->GroupOptionName && $item->Visible && $item->Body <> "") {

Client Scripts
$('.ewDelete').hide(); // works ok on client scripts but leave an empty column.

Thanks.


riverman
User
Posts: 158
Location: Stockholm/Sweden

Post by riverman »

When changing in list page, you use ListOptions (search in help file).

Example of hiding delete in list page:

function ListOptions_Load() {

// Hide default links for view/edit/delete
$this->ListOptions->Items["delete"]->Visible = FALSE;

}

In client script you'll have a empty column because you only hide the content. Perhaps (have not tested my self) you can use: ".ewTableLastCol"


sangnandar
User
Posts: 980

Post by sangnandar »

Thanks for the pointer, it works.

Server Events -- Table Specific -- List Page
function ListOptions_Load() {
$this->ListOptions->Items["delete"]->Visible = FALSE;
}


Post Reply