如何在带有引导主题的dataview中设置自定义图标 [英] How to set a custom icon in dataview with bootstrap theme

查看:212
本文介绍了如何在带有引导主题的dataview中设置自定义图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在xpages dataview上设置一个带有字形或自定义上传图标的自定义图标,但图标总是默认为文件图标。 Im使用引导主题和最新的xpages扩展lib(r10)。

I want to set a custom icon with glyphicons or custom uploaded icon on xpages dataview, but the icon always defaults to file icon. Im using bootstrap theme and latest xpages extension lib (r10).

我想更改dataview文档行中的图标,而不是分类图标。带bootstrap主题的代码总是默认为这个代码。

I want to change the icon in the dataview document row, not the categorization icon. The code with bootstrap theme always defaults to this code.

<div class="glyphicon glyphicon-file xspReadIcon"></div> 

我试过:

<xe:iconEntry selectedValue="read" url="/legalforms.gif" styleClass="hidden-xs"></xe:iconEntry>
<xe:iconEntry selectedValue="read" url="/legalforms.gif" styleClass="glyphicons glyphicons-user"></xe:iconEntry>


推荐答案

看起来您在引导主题的数据视图渲染器。我们将在未来寻找解决方案。

It looks like you've found a bug in the data view renderer for the bootstrap theme. We will look into fixing that in the future. In the meantime you can try using the workaround below.

您可以使用数据视图的图标facet,通过指定 xp:key =图标。然后在构面中添加一个带有自定义styleClass的div。例如:

You can use the icon facet of the data view, by specifiying xp:key="icon". Then add a div with a custom styleClass in the facet. For example:

<xe:dataView id="dataView1">
    ....
    <xe:this.facets>
      <xp:panel xp:key="icon">
        <xp:div>
             <xp:this.styleClass>
                 <![CDATA[#{javascript:
                     var doc:NotesDocument = viewEntry.getDocument();
                     if(doc.getRead()) {
                         return "hidden-xs";
                     }else{
                        return "glyphicon glyphicon-user";
                     }
                }]]>
            </xp:this.styleClass>
        </xp:div>
      </xp:panel>
    </xe:this.facets>
</xe:dataView>

这篇关于如何在带有引导主题的dataview中设置自定义图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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