T - the row typepublic class DataTable<T> extends Object implements Table<T>
attach() after the data table element was added to the DOMTable methods
Sample which uses a FooBar as the row type:
class FooBar {
final String foo;
final String bar;
FooBar() {
this.foo = "Foo-" + String.valueOf(Random.nextInt(12345));
this.bar = "Bar-" + String.valueOf(Random.nextInt(12345));
}
}
Options<FooBar> options = new OptionsBuilder<FooBar>()
.button("Click Me", (table) -> Window.alert("Hello"))
.column("foo", "Foo", (cell, type, row, meta) -> row.foo)
.column("bar", "Bar", (cell, type, row, meta) -> row.baz)
.options();
DataTable<FooBar> dataTable = new DataTable<>("sample", options);
Table.SelectionChangeHandler<T>| Constructor and Description |
|---|
DataTable(String id,
Options<T> options) |
| Modifier and Type | Method and Description |
|---|---|
elemental2.dom.HTMLElement |
asElement() |
void |
attach()
Initialized the
Api instance using the Options given at constructor argument. |
void |
bindForm(Form<T> form)
Binds a form to the table and takes care to view or clear the form upon selection changes
|
void |
bindForms(Iterable<Form<T>> forms) |
protected JQuery |
buttonElement(int index) |
void |
clear() |
void |
enableButton(int index,
boolean enable) |
List<T> |
getRows() |
void |
hide() |
void |
onSelectionChange(Table.SelectionChangeHandler<T> handler) |
void |
select(T data) |
void |
select(T data,
Function<T,String> identifier)
Selects the row with the specified data.
|
T |
selectedRow() |
List<T> |
selectedRows() |
void |
show() |
void |
update(Iterable<T> data)
Replaces the existing data with the new one.
|
void |
update(Iterable<T> data,
Function<T,String> identifier) |
void |
update(Iterable<T> data,
RefreshMode mode) |
void |
update(Iterable<T> data,
RefreshMode mode,
Function<T,String> identifier)
Replaces the existing data with the new one.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasSelectiondetachpublic elemental2.dom.HTMLElement asElement()
asElement in interface org.jboss.gwt.elemento.core.IsElementpublic void attach()
Api instance using the Options given at constructor argument. Make sure to call
this method before using any of the API methods. It's safe to call the methods multiple times (the
initialization will happen only once).attach in interface Attachableprotected JQuery buttonElement(int index)
public void enableButton(int index,
boolean enable)
enableButton in interface Table<T>public void bindForm(Form<T> form)
public void onSelectionChange(Table.SelectionChangeHandler<T> handler)
onSelectionChange in interface Table<T>public T selectedRow()
selectedRow in interface Table<T>public List<T> selectedRows()
selectedRows in interface Table<T>public void select(T data, Function<T,String> identifier)
public void update(Iterable<T> data, RefreshMode mode)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.