Hide Column in Related Item on depending another column

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
RMIC
Posts: 96
Joined: Sun May 10, 2015

21 Feb 2019

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!

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

28 Feb 2019

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.

RMIC
Posts: 96
Joined: Sun May 10, 2015

28 Feb 2019

That's great. It work.
Thank you!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests