cblehman wrote:
>
> It looks like they insert default classes "headers" "even" and "odd"
> into the table header and rows, but I was wondering if there is an easy
> way for me to either set a property or create a subclass so that I can
> use my own class names rather than these defaults?
>
Try:
public class MyDataTable extends DataTable {
public MyDataTable(String id, IColumn[] columns,
ISortableDataProvider dataProvider, int rowsPerPage) {
super(id, columns, dataProvider, rowsPerPage);
addTopToolbar(new NavigationToolbar(this));
addTopToolbar(new MyHeadersToolbar(this, dataProvider));
addBottomToolbar(new NoRecordsToolbar(this));
}
protected Item newRowItem(String id, int index, IModel model) {
Item item = super.newRowItem(id, index, model);
item.add(new AttributeModifier("class", true, new Model(
index % 2 == 0 ? "myEven" : "myOdd")));
return item;
}
}
public class MyHeadersToolbar extends HeadersToolbar {
public MyHeadersToolbar(DataTable table, ISortStateLocator
stateLocator) {
super(table, stateLocator);
}
}
MyHeadersToolbar.html:
<wicket:panel>
<tr class=\"myHeaders\">
<span wicket:id=\"headers\">
<th wicket:id=\"header\"><span
wicket:id=\"label\">[header-label]</span></th>
</span>
</tr>
</wicket:panel>
--
View this message in context:
http://www.nabble.com/DataTable-question-tf4535291.html#a12951941
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]