Page 1 of 1

Disable "new item" on related items when in display-mode

Posted: 17 Nov 2021
by UDRO
Hi,

I would like to put something like:

if(fd._formType() == 'Display'){
// code to disable "new item" on related item
}

in the Javascript of a form. Is this this possible?

Thank you, UDRO

Re: Disable "new item" on related items when in display-mode

Posted: 17 Nov 2021
by Nikita Kurguzov
Dear UDRO,
You can do it with the following code:

Code: Select all

fd.relatedItems()[0].find('.ms-list-addnew').hide();
Replace 0 with the index of the Related Items control.

Re: Disable "new item" on related items when in display-mode

Posted: 17 Nov 2021
by UDRO
Thank you!

UDRO