Domanda

I would like to create a sharepoint 2013 solution (.wsp) that could be easily deployed and would contain a basic CSR(JSlink) that would modify all views in the site collection. I have been able to use JSlink when I attached it to webpart, but I have not been able to find out how to change it so it could be attached as a part of a WSP file.

thank you so much for your help.

È stato utile?

Soluzione 2

I have found a way. I needed to create a sandboxed solution, then add files to feature and set in XML that javascript has to be deployed in masterpages folder. then just deploy and activate solution and JSlink file will be added into scripts in masterpage code.

Altri suggerimenti

If you want to attach a CSR file via JSLink to all existing views, you will have to use a feature event receiver to access the views through code and automate that process.

If you want to attach a CSR file via JSLink to a view that is on some new content that is being deployed as part of the WSP, you can do so via the JSLink element in a view definition.

CAML View element

(JSLink is not mentioned as a child element, but it is usable. If you create a list definition/instance in VS, you will see it.)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top