0

I want to make a list item read only for a certain group when one of it's column has a value of "Completed".

I want to achieve it through jquery and server side code.

1
  • You need to break the item level permission for that group and assign it to Read-only when a column value is "Completed". Mar 7, 2022 at 5:38

1 Answer 1

0

Adding the following JSLink to the list view will make the Completed field read-only while in Quick Edit mode.

(function () {
    var overrideContext = {};
    overrideContext.Templates = overrideContext.Templates || {};

    overrideContext.Templates.OnPreRender = function (ctx) {
        disableGridEditing("Completed");
    }

    function disableGridEditing(fieldName) {
        var fields = ctx.ListSchema.Field.filter(function (f) {
            return f.Name === fieldName;
        });
        if (fields.length > 0) {
            fields[0].AllowGridEditing = false;
        }
    }

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideContext);
})();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.