Xpages, Bootstrap and Data Views

一个人想着一个人 提交于 2019-12-25 09:57:26

问题


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.

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.

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.

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


回答1:


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>


来源:https://stackoverflow.com/questions/34443882/xpages-bootstrap-and-data-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!