MultiChoice Field wordwrap

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
TWendt
Posts: 109
Joined: Mon Sep 08, 2014

27 Jun 2018

Hi all,

is it possible to wordwrap a MultiChoice field (30 items)?

Best wishes
Tom

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

27 Jun 2018

Dear Tom,
Should be possible, but can you provide us some screenshots, so we can better help? To see what you have right now and what you want to see instead.
Cheers

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

27 Jun 2018

Hi,
i added the sreenshot. Is it possible to mwordwrap the items horizontal?

Best wishes
Tom
Attachments
Standorte.GIF
Standorte.GIF (22.14 KiB) Viewed 1958 times

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

28 Jun 2018

Dear Tom,
You can try the following JavaScript, just insert it inside JS editor on the form, replace field name with the InternalName of Standort/e field, and replace width with what you need, it should wrap the labels appropriately:

Code: Select all

fd.field('Choice').control()._el().find('td').attr('style', 'width: 150px; word-wrap: break-word;');
Cheers

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

16 Jul 2018

Dear Nikita,

sorry, did not work.

Best wishes
Tom

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

16 Jul 2018

Dear Tom,
My bad, try this instead, should really work now:

Code: Select all

fd.field('Choice').control()._el().find('td').attr('style', 'width: 100px; word-wrap: break-word;');
fd.field('Choice').control()._el().find('table').attr('style', 'width: 100px; table-layout: fixed;');
Of course, you can adjust Width to your needs, just change it in both places.
Cheers

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

19 Jul 2018

Dear Nikita,

no changes. I added you code in the JS editor. Bu nothing changed.

Best wishes
Tom
Attachments
WordWrap.GIF
WordWrap.GIF (56.26 KiB) Viewed 1925 times

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

19 Jul 2018

Dear Tom,
You do need to change Choice to the InternalName of your field. Click on the field in the designer, and check its internal name on the right:
InternalName.png
InternalName.png (4.54 KiB) Viewed 1920 times
Cheers

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

19 Jul 2018

Hi Nikita,

Sorry wrong screenshot. But the script did not work.


Best wishes

Tom

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

19 Jul 2018

Dear Tom,
This is indeed very weird.

No effect at all? Or maybe we have something different in mind? Here is me running the script from console:
CheckboxesWrap.png
CheckboxesWrap.png (26.51 KiB) Viewed 1918 times
It also works from the designer, I've checked that. But try the console as well, and show me a screenshot. Have to make sure there are no errors.

Perhaps, it's a browser difference or a different version of SharePoint. What browser are you using? And what is your version of SharePoint?
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests