Sharepoint - How to add JSLink to a field through pnp?
Set the JSLink to a field using JSOM:
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(setJslink, 'sp.js');
function setJslink()
{
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var field = web.get_availableFields().getByTitle("Description");
context.load(field);
context.executeQueryAsync(function(){
field.set_jsLink("~sitecollection/SiteAssets/suggestion.js");
field.updateAndPushChanges(true);
context.executeQueryAsync(function(){
var jsl = field.get_jsLink();
console.log(jsl);
});
});
}
</script>
Reference:
Set JSLink on a Site Column With JSOM