0

When users selects multiple options in a checkbox, the list shows all the selections separated by commas however if many options are selected, the column will take up most of the screen accommodating probably due to the string being one long data entry. Is there away to break it up? Also, should I just create a space after each option in the list settings?

Update 7-26-2019 per Ganesh Sanap's request: Found code used by the developer who created this app on one of his other SharePoint Sites.

function addSpaceComponent(item) {
  if (item == undefined || null) {
    return "";
  } else {
    return item.join(", ");
  }
}

Then it is called like so:

addSpaceComponent(list[i].LongStringData),
  • Creating space after each option will not change anything... Which version of SharePoint you are using? – Ganesh Sanap Jul 19 at 13:39
  • @GaneshSanap, I am using 2013 and you are correct, adding a space didn't do anything...it looked like it trimmed the white spaces. – adams-j Jul 19 at 14:28
  • If you are using 2013 then Maybe you can use JSLink (Client side rendering) and do some scripting according to your need. – Ganesh Sanap Jul 19 at 14:55
  • @GaneshSanap, yes. After doing a little bit more research, I think I'm just going to loop through all the list items and split out the commas and replace with a <br />. Thanks. – adams-j Jul 19 at 15:02
  • Welcome. After you figure it out then add complete code you used in JSLink in Answer section below for other community user's reference. – Ganesh Sanap Jul 19 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.