Page 1 of 1

Related Items control - howto set grid as read-only

Posted: 07 Jun 2017
by Patrick1010
Hello Dmitry,

I’m using the Related Items control in the edit mode and everything is working nicely.
I’m only facing the problem to set the Grid into Read-only mode after the process is completed (tracked by status value).

I'm wondering is there a way to set the whole grid into ready-only mode (which also includes that deletion should not be possible) without having to create a new form group?

For example could I set the Forms Designer Client > Related Item control > Editable property to "false" by javascript code?

Re: Related Items control - howto set grid as read-only

Posted: 08 Jun 2017
by Dmitry Kozlov
Hi,

The following code disables all columns in the grid:

Code: Select all

var ctx = fd.relatedItems(0).data('ctx');
ctx.ListSchema.Field.forEach(function(f) {
	f.AllowGridEditing = "FALSE"
});

EnsureScriptParams('inplview', 'InitGridFromView', ctx.view);
But users can still delete rows and use a context menu. Our support team can implement a script that disables the context menu and prevents deleting rows. It will take two support hours:
https://spform.com/buy/support-maintenance

Re: Related Items control - howto set grid as read-only

Posted: 09 Jun 2017
by Patrick1010
Hello Dmitry,

Thanks a lot, this works perfectly!