Selected Items in Related-items

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

19 Feb 2019

Hi,

How do I get "just" selected items' (one or more) column value in related-item?

Screenshot_5.png
Screenshot_5.png (16.14 KiB) Viewed 2142 times
Best regards.

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

21 Feb 2019

Hi!

We are working on your issue.

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

21 Feb 2019

Thanks a lot, I am waiting for your good news :)

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

21 Feb 2019

Hi!

I would like to clarify one moment before suggesting the solution, what do you mean by selection:

1) Filtering by changing the lookup field

2) Applying some conditions on displayed related items

3) Selecting in the Quick Edit mode:
Screenshot_138.png
Screenshot_138.png (6.15 KiB) Viewed 2128 times

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

22 Feb 2019

Hi,

I want to get only one columns' values.

Exp: First I select 3 columns. When I click button, take colums' values. (Main2;Main3;Title4)

Is it possible?

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

26 Feb 2019

Anyone help me?

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

27 Feb 2019

Hi!

I'm sorry for a late reply.

First of all, you should assign the custom CSS class to the Related Items control e.g. related-items. Then you can add a button to the form and add this code to the OnClick property of the button:

Code: Select all

var index = $(".related-items").find('th:contains("Title")').index() + 2;
var array = $(".related-items").find('table tr > td:nth-child('+index+')[style*="background-color: rgb(199, 224, 244);"], table tr > td:nth-child('+index+').ms-jsgrid-cell-selected-editable').find('a.ms-listlink');
var textArray=[];
for (var i=0;i < array.length; i++ ){
   textArray.push(array[i].text)
}
console.log(textArray);
Notice that you should replace "Title" with the displayed name of the column you want to be saved in the array.

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

27 Feb 2019

Hi again,

Unfortunately not work(alert shows blank) :/ Can't we select items without edit mode?

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

28 Feb 2019

Hi!

Unfortunately, not, only in the Edit mode. Please try again in the Edit mode.

Office365Guy
Posts: 21
Joined: Sun Feb 24, 2019

16 Mar 2019

Using the code above I get the Index returned for the column I want but the Array length is still 0? What am I doing wrong.

My goal is to allow a user to Quick Edit the related items and select 1 row. I need 1 column from the selected row only.

Thanks in advance

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests