SharePoint列表标题的508合规性问题 [英] 508 Compliance Issue for SharePoint List Header

查看:111
本文介绍了SharePoint列表标题的508合规性问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SharePoint列表标题包含用于附件的图标,例如回形针.但是,它不兼容508,因为它是网络图像,但没有ALT,TITLE或ARIA属性.有添加这些的解决方案吗?

SharePoint list header contains icon such as paper clip for attachment. However, it is not 508 compliant since it's a web image but it does not have ALT, TITLE, or ARIA attribute. Is there a solution to add those?

谢谢.

推荐答案

您可以在SharePoint中自定义CSR以添加其他属性根据您的要求.

此处是为附件文件添加CSR的示例脚本供您参考.

(function () {
    'use strict';

    var CustomCtx = {};

    /**
     * Initialization
     */
    function init() {

        CustomCtx.Templates = {};

        CustomCtx.Templates.Fields = {            
            'Attachments': {
                'View': customDisplay
            }
        };

        // Register the custom template
        SPClientTemplates.TemplateManager.RegisterTemplateOverrides(CustomCtx);
    }

    /**
     * Rendering template
     */
    function customDisplay(ctx) {
        var currentVal = '';
        //from the context get the current item and it's value 
        if (ctx != null && ctx.CurrentItem != null)
            currentVal = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
		
		//you could get more details by REST api and add to custom render format
        var el = "<img width='16' alt='alt' title='title' height='16' src='/_layouts/15/images/attach16.png?rev=23' border='0' />";

        // Render the HTML5 file input in place of the OOTB
        return el;
    }

    // Run our intiialization
    init();

})();

如果您想获取附件的更多详细信息,您可以调用REST api来获取它.

对于SharePoint CSR,您可以在下面的链接中查看更多细节.

最好的问候,

Lee


这篇关于SharePoint列表标题的508合规性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆