Page 1 of 2

MultiChoice Field wordwrap

Posted: 27 Jun 2018
by TWendt
Hi all,

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

Best wishes
Tom

Re: MultiChoice Field wordwrap

Posted: 27 Jun 2018
by Nikita Kurguzov
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.

Re: MultiChoice Field wordwrap

Posted: 27 Jun 2018
by TWendt
Hi,
i added the sreenshot. Is it possible to mwordwrap the items horizontal?

Best wishes
Tom

Re: MultiChoice Field wordwrap

Posted: 28 Jun 2018
by Nikita Kurguzov
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;');

Re: MultiChoice Field wordwrap

Posted: 16 Jul 2018
by TWendt
Dear Nikita,

sorry, did not work.

Best wishes
Tom

Re: MultiChoice Field wordwrap

Posted: 16 Jul 2018
by Nikita Kurguzov
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.

Re: MultiChoice Field wordwrap

Posted: 19 Jul 2018
by TWendt
Dear Nikita,

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

Best wishes
Tom

Re: MultiChoice Field wordwrap

Posted: 19 Jul 2018
by Nikita Kurguzov
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 1923 times

Re: MultiChoice Field wordwrap

Posted: 19 Jul 2018
by TWendt
Hi Nikita,

Sorry wrong screenshot. But the script did not work.


Best wishes

Tom

Re: MultiChoice Field wordwrap

Posted: 19 Jul 2018
by Nikita Kurguzov
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 1921 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?