View Archives : Binary Bits https://blog.binarybits.net/tag/view/ Bits & Pieces - A blog by Kannan Balasubramanian Tue, 20 Jun 2017 09:30:13 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.2 Sharepoint list quick edit not available? https://blog.binarybits.net/sharepoint-list-quick-edit-not-available/ https://blog.binarybits.net/sharepoint-list-quick-edit-not-available/#respond Tue, 20 Jun 2017 09:28:44 +0000 https://blog.binarybits.net/?p=897 When you are vieweing a custom view and don’t see the “Edit” menu also called as “Quick Edit”, make sure that particular view has the “Tabular View” configured. This is one of the reasons why sharepoint list’s quick edit is not available in custom viewes. Steps to configure “Tabular View” to enable quick edit. Goto […]

The post Sharepoint list quick edit not available? appeared first on Binary Bits.

]]>
When you are vieweing a custom view and don’t see the “Edit” menu also called as “Quick Edit”, make sure that particular view has the “Tabular View” configured. This is one of the reasons why sharepoint list’s quick edit is not available in custom viewes.

Steps to configure “Tabular View” to enable quick edit.

  1. Goto -> List Settings -> Views -> Click on the view where the “Edit” doesn’t show up
  2. In the view edit page, expand “Tabular View” if not already expanded
  3. Check the “Allow individual item checkboxes ” checkbox.
  4. Click “OK” to save the view settings

Now the quick edit should have been enabled.

Note: This is applicable for modern view available in Office 365, SharePoint 2016 & SharePoint 2013.

The post Sharepoint list quick edit not available? appeared first on Binary Bits.

]]>
https://blog.binarybits.net/sharepoint-list-quick-edit-not-available/feed/ 0
Display attachments using JSLink in SharePoint https://blog.binarybits.net/display-attachments-using-jslink-in-sharepoint/ https://blog.binarybits.net/display-attachments-using-jslink-in-sharepoint/#respond Tue, 30 May 2017 10:20:58 +0000 https://blog.binarybits.net/?p=888 Recently I had a requirement where the customer wanted to show the actual attachment’s URL in the list view instead of default Icon. Following JSLink code will help to do that. (function () { var linkFiledContext = {}; linkFiledContext.Templates = {}; linkFiledContext.Templates.Fields = { "Attachments": { "View": OverrideAttachmentFieldRendering } }; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFiledContext); })(); function OverrideAttachmentFieldRendering(ctx) { […]

The post Display attachments using JSLink in SharePoint appeared first on Binary Bits.

]]>
Recently I had a requirement where the customer wanted to show the actual attachment’s URL in the list view instead of default Icon. Following JSLink code will help to do that.

(function () {
    var linkFiledContext = {};
    linkFiledContext.Templates = {};
    linkFiledContext.Templates.Fields = {
        "Attachments": { "View": OverrideAttachmentFieldRendering }
    };
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFiledContext);
})();

function OverrideAttachmentFieldRendering(ctx) {
    var itemId = ctx.CurrentItem.ID;
    var listName = ctx.ListTitle;
    return GetAttachments(listName, itemId);
}

function GetAttachments(listName, itemId) {
    var url = _spPageContextInfo.webAbsoluteUrl;
    var requestUri = url + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")/AttachmentFiles";
    var htmlString = "<span style='white-space: nowrap;'>No attachment(s)</span>";

    $.ajax({
        url: requestUri,
        type: "GET",
        headers: { "ACCEPT": "application/json;odata=verbose" },
        async: false,
        success: function (data) {
            for (var i = 0; i < data.d.results.length; i++) {
                htmlString += "<a style='white-space: nowrap;'  href='" + data.d.results[i].ServerRelativeUrl + "'>" + data.d.results[i].FileName + "</a>";
                if (i != data.d.results.length - 1) {
                    htmlString += "<br/>";
                }
            }
        },
        error: function (error) {
            console.log("An error occured while fetching attachment details. Details: " + JSON.stringify(error))
        }
    });

    return htmlString;
}

Source: https://social.msdn.microsoft.com/Forums/office/en-US/29f7998f-ffc5-4877-b975-a49631b53ba2/show-attachments-with-jslink?forum=sharepointdevelopment

The post Display attachments using JSLink in SharePoint appeared first on Binary Bits.

]]>
https://blog.binarybits.net/display-attachments-using-jslink-in-sharepoint/feed/ 0