Page 1 of 1

Hide Column in Related Item on depending another column

Posted: 21 Feb 2019
by RMIC
Hello,

how is it possible to hide columns in the Related Item, depending on another column (this column is not in the Related Item)?

Example:
If "€" is in the column "Currency", the "Foreign currency" column should not be displayed in the Related Item.
If "$" is in the column "Currency", the "Foreign currency" column should be displayed in the Related Item.

Thank you!

Re: Hide Column in Related Item on depending another column

Posted: 28 Feb 2019
by AlexZver
Hi!

I'm sorry for a late reply. You can hide and show the column in the Related Items by this code:

Code: Select all

var index = $(".related-items").find('th:contains("Title")').index() + 2;
var array = $(".related-items").find('table tr > td:nth-child('+index+'), table tr > th:nth-child('+index+')');
array.hide();
//array.show();
Notice that you should replace "Title" with the displayed name of the column you want to hide.

Re: Hide Column in Related Item on depending another column

Posted: 28 Feb 2019
by RMIC
That's great. It work.
Thank you!