Hide column in deletepage

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Hide column in deletepage

Post by digitalphotoworld »

I tried to hide some columns in deletepage, but it don't work.

In listpage we could use the following code:

$GLOBALS["<mytable>"]-><myfield>->Visible = FALSE;

What and where to use in delete page?


mobhar
User
Posts: 11905

Post by mobhar »

Unfortunately, in the Delete Page, you cannot hide the column using server event. CMIIW. ;)

The closest approach to achieve it is by adjusting the fields from the "Fields" setup of PHPMaker. Uncheck your desired field(s) under the "List" column, and it won't be displayed in the Delete page, too.


danielc
User
Posts: 1599

Post by danielc »

There is no check for visible field in delete page and hence you can not use server event to hide a field. So, you need to use jQuery to hide your field instead.


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

I have a quick&dirty solution with Jquery, perhaps it helps someone:

In Client Scripts -> Table Specific -> Delete -> Startup Script add

     $('td:nth-child(3)').hide();

Replace 3 with your column to be hidden. If you want to hide more than one line, just repeat it like this:

      $('td:nth-child(3)').hide();
			$('td:nth-child(6)').hide();
			$('td:nth-child(10)').hide();
			$('td:nth-child(11)').hide();

This works for me, except one condition. If you want to hide the first column, the whole table will disapear. Perhaps someone could figure out the reason.


Post Reply