1

I am working on a requirement that requires me to disable one field from editing (even in the quick edit mode). I just want user to add new record and update existing records (except one field).

I am able to achieve something and remove the fields from quick edit, however i see that on focus of the cell, quick edit adds a new control (drop down), has anyone figured out a way to disable that?

Any suggestions...

enter image description here

3
  • Hi, did you found any solution for the above issue?
    – Light
    Jun 1, 2016 at 12:49
  • @light nope i didnt find any solution for this, i ended up using the code below to disable rows. Jun 10, 2016 at 19:45
  • how can I disable specific cell in a row based on value using below code, I'm not able to find that...
    – Light
    Jun 16, 2016 at 11:03

2 Answers 2

3

You could try using AllowGridEditing with JS Link like this (example with Title):

var fieldContext = {
  Templates: {
    Fields: {
      LinkTitle: {
        View: function(ctx, b) {
          b.AllowGridEditing = false;
          return ctx.CurrentItem.Title;
        }        
      }
    }
  }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(fieldContext); 
3
  • Thanks Eiri, I would like use to be able to add new records, just not update the old records. I assume this script will not let him enter anything for the column. I will give it a try. May 6, 2014 at 14:38
  • is there a way we can prevent this template from overriding the last row. May 6, 2014 at 16:42
  • as expected this is making the field read only for all the rows...I want to either exclude the last row, or a way of setting value for the disabled field using script. any pointers May 6, 2014 at 22:02
0

You can use approach used in below blog

http://sharepointbitsandbytes.com/2014/01/sharepoint-2013-quick-edit-javascript-validation/

I was exploring it for composite validation purpose. Not working for me. But while implementing same functionality was achieved at cell level for which ever column you want to implement.

Your Answer

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

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