I am working on a custom list, and inside the list view i am showing the Title(linked to item with edit menu)
column. currently when users click on this column they will be redirected to the item display form. now our customer is asking if we can redirect to different URL when clicking on the list items?
so instead of redirecting to the item display form:-
/Lists/Projects/DispForm.aspx?ID=86
to be redirected to a sub-site that have the item ID, such as:-
/sites/86/
Thanks
EDIT here is my JS link , but it did not have any effect on the views:-
(function () {
function registerRenderer() {
var ctxForm = {};
ctxForm.Templates = {};
ctxForm.Templates = {
Fields : {
'LinkTitle': { //------ Change Hyperlink from LinkTitleNoMenu field
View : function (ctx) {
var url = String.format('{0}?ID={1}', "/PMO/Projects/", ctx.CurrentItem.ID);
return String.format('<a href="{0}" onclick="EditItem2(event, \'{0}\');return false;">{1}</a>', url, ctx.CurrentItem.Title);
}
},
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctxForm);
}
ExecuteOrDelayUntilScriptLoaded(registerRenderer, 'clienttemplates.js');
})();