Question

I have a list instance being created from a SharePoint Hosted App. How can change the JSLink reference from within the list definition, schema.xml ? I can change it on a List view like so:

<JSLink>~site/Scripts/customRenderer.js</JSLink>

But how do I change it for newForm.aspx? Is there a JSLink attribute buried in this XML?

<Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx"  SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx"  WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
Was it helpful?

Solution

You can do it as

<Form Type="NewForm" 
      Url="NewForm.aspx" 
      SetupPath="pages\form.aspx" 
      WebPartZoneID="Main" 
      JSLink="~site\path\jslinkfile.js" />
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top