Page 1 of 1

Hide column in deletepage

Posted: Mon Sep 09, 2013 3:39 pm
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?


Re: Hide column in deletepage

Posted: Tue Sep 10, 2013 11:10 am
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.


Re: Hide column in deletepage

Posted: Tue Sep 10, 2013 11:46 am
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.


Re: Hide column in deletepage

Posted: Tue Sep 10, 2013 6:06 pm
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.