Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Display URL value as "Edit" in custom list - AllItems view

$
0
0

HI,

I have a column which contains a Note field and stores a URL.

I would like to display in the custom list "AllItems.aspx" view as "Edit" with a hyperlink for that column, so that the whole link is not visible, and a Hyperlink is shown. I have tried the below with JSLink, but the link is not getting changed.

I have tried the below code:

(function () {
    var statusFieldCtx = {};

    statusFieldCtx.Templates = {};

    statusFieldCtx.BaseViewID = 1;
    statusFieldCtx.ListTemplateType = 10003;

    statusFieldCtx.Templates.Fields = {
        "TestFormUrl": {"View": StatusFieldViewTemplate
        }
    };

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(statusFieldCtx);
})();


function StatusFieldViewTemplate(ctx) {
    if (ctx != null && ctx.CurrentItem != null)

var priority = ctx.CurrentItem.TestFormUrl;
 
priority  = "<a href='"+ priority +">Edit</a>";
return priority;
}

How to fix this?

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>