Related Items control - howto set grid as read-only

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Patrick1010
Posts: 11
Joined: Wed Jun 07, 2017

07 Jun 2017

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

08 Jun 2017

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

Patrick1010
Posts: 11
Joined: Wed Jun 07, 2017

09 Jun 2017

Hello Dmitry,

Thanks a lot, this works perfectly!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests