Listing lookup values from multi-seletion looup field on display form
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
A SharePoint list has a multi-selection lookup field.
When 2 or more values are selected for an item,it is displayed(in the view)as:
Value1,Value2,Value3,Value4,Value5,Value6
Is there a way that I can display this field as shown below?
Value1,
Value2,
Value3,
Value4,
Value5,
Value6
Thanks!
When 2 or more values are selected for an item,it is displayed(in the view)as:
Value1,Value2,Value3,Value4,Value5,Value6
Is there a way that I can display this field as shown below?
Value1,
Value2,
Value3,
Value4,
Value5,
Value6
Thanks!
-
- Posts: 29
- Joined: Fri May 25, 2018
Hi vegard.grutle,
i am doing it like this:
Greetz
i am doing it like this:
Code: Select all
//.. HTML auslesen
var vDummy = fd.field("Risiko").control()._el().html();
//.. Semikolon mit Zeilenumbruch im gesamten (/g) String ersetzen
vDummy = vDummy.replace(/; /g, "<br>");
//Wert zurückschreiben
fd.field("Risiko").control()._el().html(vDummy);
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear slashmaster,
It's a pretty neat piece of code! Thank you for answering - we love to see community interactions like this.
It's a pretty neat piece of code! Thank you for answering - we love to see community interactions like this.
Cheers
-
- Posts: 29
- Joined: Fri May 25, 2018
Hello Nikita,
thanks a lot. i'll try my best for "Knowledge Sharing"
greetz
thanks a lot. i'll try my best for "Knowledge Sharing"
greetz
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
Thanks, slashmaster
Im not too much into coding. Could you please let me know what "vDummy" represent. I would think that "Risiko" is the name of the field.
Thanks!
Im not too much into coding. Could you please let me know what "vDummy" represent. I would think that "Risiko" is the name of the field.
Thanks!
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Vegard,
This is just a variable to temporarily store the HTML from the field and format it into a column, which then replaces the default HTML of the field. You can change the name of the variable, just make sure it's the same everywhere, and use the correct internal name for the field.
This is just a variable to temporarily store the HTML from the field and format it into a column, which then replaces the default HTML of the field. You can change the name of the variable, just make sure it's the same everywhere, and use the correct internal name for the field.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests