0

I'm new to SharePoint and JS Link. I have to read the metadata of a document in a document library. If the document is locked for the current user, I want to create an extra column and display an image in that field (of the Column) to show that the document is locked.

So I want to know: Is it possible to create a new column and read the metadata of a document in my JavaScript? If so, how do I do that?

Or, do I have to create the Column manually in SharePoint before I can re-render the fields via JS Link?

0

The whole point of CSR you can display existing Columns anyway you want, so there is no need to Create another Column

https://code.msdn.microsoft.com/office/Client-side-rendering-code-97e27fa1/sourcecode?fileId=109736&pathId=1717720622

Is an MSDN example which uses another field to indicate if a document is locked.

  • Thanks for your answer. Yes, he is using another field for looking at the permission, but is there a way to get the "yes/no" value out of the metadata of the document ? – Casativa Oct 22 '15 at 13:43
  • Sure, the ctx has all the metadata available in the current View With a View displayed you can check in F12 Dev Tools: ctx.ListData.Row[0] – Danny '365CSI' Engelman Oct 22 '15 at 14:00
  • What metadata says/identifies the document is locked? – Danny '365CSI' Engelman Oct 22 '15 at 14:01
  • OK thanks, I will look for the ctx.ListData.Row. It has a custom property/metadata which is called "vertraulich" / "nicht vertraulich" – Casativa Oct 22 '15 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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