even odd untuk warna grid tapestry 5

code for .tml

<table t:type="grid" t:source="listBuku" t:rowsperpage="20" t:pagerPosition="top" add="del,kategori,penerbit,rak" t:reorder="del,kode_buku,judul_buku,pengarang,stok,kategori,penerbit,rak" t:row="buku" rowClass="${evenodd}" >
 <t:parameter name="judul_bukucell">
 <a t:type="actionlink" t:id="edit" t:context="${buku.id_buku}">${buku.judul_buku}</a>
 </t:parameter>
 <t:parameter name="delCell">
 <input t:type="Checkbox" t:id="delete" value="delete"/>
 </t:parameter>
 <t:parameter name="kategoricell">
 ${buku.kategori.nama_kategori}
 </t:parameter>

<t:parameter name="penerbitcell">
 ${buku.penerbit.nama_penerbit}
 </t:parameter>

<t:parameter name="rakcell">
 ${buku.rak.nama_rak}
 </t:parameter>
 </table>

code for .java :

/*

** evenodd method

*/

private int i = 0;
 public String getEvenOdd() {
 i++;
 return i % 2 == 0 ? "odd" : "even";
 }

tambahkan css script untuk row odd dan row even

 TABLE.t-data-grid TBODY TR.odd {
 background-color: #eefbb1;
 }

TABLE.t-data-grid TBODY TR.even {
 background-color: #ffffff;
 }

😀 Selesai

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s