Xpages、Bootstrap 和数据视图 [英] Xpages, Bootstrap and Data Views

查看:21
本文介绍了Xpages、Bootstrap 和数据视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Bootstrap 主题的 Xpage 应用程序中有一个数据视图.我开始使用视图,但永远无法让寻呼机排队,并且数据视图工作得更好.

I have a Data View in an Xpage application which is using the Bootstrap theme. I started to use a View, but could never get the pagers lines up, and the data view is working better.

但我不明白把我的表类 css 放在哪里.例如,如果我想要一个剥离表,我在视图的 styleClass 中输入table table-striped"(或者它可能是 dataStyleClass).如果我在数据视图的 styleClass 中这样做,我不会得到条.

But I do not understand where to put my table class css. For example, if I want a stripped table I enter "table table-striped" in the styleClass of the view (or maybe it is the dataStyleClass). If I do that in the styleClass of the data view, I do not get strips.

我尝试了下面马克的建议,但有些东西不起作用.我添加了一个脚本调用并使用了 tableview 的 id.它上面已经有一个清除表"类.

I tried the suggestion from Mark below, but something is not working. I added a script call and used the id of the tableview. It already has a class of "cleearfix table" on it.

我添加了 Chrome 的网络检查器来显示正在发生的事情.

I have added Chrome's web inspector to show what is going on.

推荐答案

xe:dataView 控件确实有一个 styleClass 属性,但是添加了您在那里设置的类到包装数据视图的 div 元素,而不是 table (这就是 Bootstrap 需要 table-striped 类的地方.我会用一些 JavaScript 来在 table 元素上添加你需要的类

The xe:dataView control does have a styleClass attribute, but classes that you set there are added to the div element that wraps the dataview, not the table (and that's where Bootstrap needs the table-striped class. I would solve this with some JavaScript to add the classes you need on the table element

<xp:scriptBlock
id="scriptBlock1">
  <xp:this.value><![CDATA[
    $("table.dataview").addClass("table-striped table-hover")
  ]]></xp:this.value>
</xp:scriptBlock>

这篇关于Xpages、Bootstrap 和数据视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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