سؤال

can please anyone can tell me to how set the row colors of the table using Skin of richfaces? in which file and what property i have to change?

Thanks

هل كانت مفيدة؟

المحلول

You can try to inspect your table using firebug and override its style in your CSS file. Something like (not exactly this):

.rf-dt-c {
  color: #FFFFFF;
}

Or you can create your own style for <rich:dataTable>, for example:

.richTable {
  width: 100%;
}
  .richTable .rowEven {
    background-color: #FFFFFF;
  }
  .richTable .rowOdd {
    background-color: #CCCCFF;
  }
  .richTable .active-row {
    background-color: #FFEBDA !important;
    cursor: pointer;
  }

set the style for your <rich:dataTable>:

<rich:dataTable id="table" var="item" value="#{bean.model}" styleClass="richTable">
  ...
</rich:dataTable>

using jQuery style the rows (even, odd, active) as you need:

<rich:jQuery selector=".richTable tr:odd" query="addClass('rowOdd')" />
<rich:jQuery selector=".richTable tr:even" query="addClass('rowEven')" />
<rich:jQuery selector=".richTable tr" event="mouseover" query="jQuery(this).addClass('active-row')"/>
<rich:jQuery selector=".richTable tr" event="mouseout" query="jQuery(this).removeClass('active-row')"/>

and of course add the jQuery to your view:

<script type='text/javascript' src='js/jquery-1.4.4.js'></script>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top