I'm following this example for using client-side rendering for my edit form. I've modified it to make the Title not editable and I want to have a "fancy" rendering for a manged metadata column.
(function () {
var customContext = {};
customContext.Templates = {};
customContext.Templates.Fields = {
"Title": {
"EditForm": readonlyFieldTemplate
},
"MyTermSet":{
"EditForm": fancyMultiTerm
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(customContext);
})();
function fancyMultiTerm(ctx){
var termset = ctx.CurrentFieldSchema.TermSetId;
// do more stuff
......
return fancyTaxonomyControl;
}
And this is working...but it isn't very portable.
Every time I want to use a fancy multiterm taxonomy control I have to change the name of the column.
Is there a way to create a client side render file that will look through all the fields that are on the page and use the custom renderer for all taxonomy fields?
Or to put it another way, is there some way to make this work when I don't know the name of the column/field in advance?
I'm looking for new and edit forms, as well as list views.