I am working on a list view, which have a choices column named "TrackingStatus". now for this choice column i define its default value to be "In Progress" insie the site columns settings.
but i have noted that inside the Quick edit grid the deault value for the "TrackingStatus" column will not be rendered (unlike inside the built-in create and edit forms).. so i tried to implement the default values using js link as follow:-
1- I upload the following script inside my site collection :-
(function () {
alert("1");
var overrideContext= {};
overrideContext.Templates = overrideContext.Templates || {};
overrideContext.Templates.Fields = {
"TrackingStatus": {
"View": function (ctx) {if(ctx.CurrentItem.your_column == "")
return "In Progress";
}
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideContext);
})();
2- Then i edit my list view webpart and i provide the following to reference the above js link under the WebPart Miscellaneous section :-
~sitecollection/Resources/defaultvalues.js
but the jslink is not having any effect in respect to applying default values for my column, although when i checked the page source i can see that the defaultvalues.js
is being loaded and i got the alert(1) which i intentionaly add inside the JsLink.. .. so can anyone advice how i can define default values for my choices columns inside the Quick Edit grid ?