2017-06-29 131 views
1

我在列表视图中有2列“名称”和“URL”,并在Web部件中仅显示“名称”。目前“名称”列设置为链接到具有编辑菜单的项目,我试图更改此名称列的URL并将其指向我的“URL”列中的URL值。链接到标题列中的其他列超链接

我在Sharepoint Designer中找到像使用“linkToItem =”TRUE“的答案,但是我的目标是更改指向编辑菜单的链接的URL,有什么建议吗?我在考虑使用JavaScript来彻底改变所有?值或使用计算的列来生成超链接,这将是一个安全,更快的解决方案

+0

你想与编辑项目链接编辑项功能指向新/自定义你的URL栏中的URL?如果是,那么你可以使用CSR来实现。 –

+0

请参阅本答案:https:// sharepoint。 stackexchange.com/questions/203041/can-force-the-titlelinked-to-item-with-edit-menu-column-inside-my-list-view/203053#203053 –

回答

0

你可以使用jslink:

(function() { 
    var overrideCtx = {}; 
    overrideCtx.Templates = {}; 
    overrideCtx.Templates.Fields = { 
     'Name': { 'View': myCustomView} 
    }; 
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); 
})(); 
function renderNameLink(ctx) { 
    var itemURL = ctx.CurrentItem["URL"]; 
    var html = "<a href='" + itemURL + "'>linkName</a>"; 
    return html; 
}