Search in sources :

Example 1 with DataTable

use of org.dominokit.domino.ui.datatable.DataTable in project nalu-examples by NaluKit.

the class ListComponent method render.

@Override
public void render() {
    TableConfig<Person> tableConfig = new TableConfig<>();
    tableConfig.addColumn(ColumnConfig.<Person>create("name", "Name").setCellRenderer(cell -> a().textContent(cell.getTableRow().getRecord().getName() + ", " + cell.getTableRow().getRecord().getFirstName()).on(EventType.click, e -> getController().doUpdate(cell.getTableRow().getRecord())).element())).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("zip", "ZIP").textAlign("right").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getZip()))).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("city", "City").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getCity())));
    this.store = new LocalListDataStore<>();
    this.table = new DataTable<>(tableConfig, store);
    initElement(Card.create("SEARCH RESULTS").appendChild(Row.create().appendChild(Column.span12().appendChild(this.table))).element());
}
Also used : ColumnConfig(org.dominokit.domino.ui.datatable.ColumnConfig) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Person(com.github.nalukit.example.nalu.loginapplication.client.data.model.dto.Person) Elements.a(org.jboss.elemento.Elements.a) LocalListDataStore(org.dominokit.domino.ui.datatable.store.LocalListDataStore) AbstractComponent(com.github.nalukit.nalu.client.component.AbstractComponent) Column(org.dominokit.domino.ui.grid.Column) DataTable(org.dominokit.domino.ui.datatable.DataTable) ArrayList(java.util.ArrayList) List(java.util.List) EventType(org.jboss.elemento.EventType) Text(elemental2.dom.Text) HTMLElement(elemental2.dom.HTMLElement) Row(org.dominokit.domino.ui.grid.Row) Card(org.dominokit.domino.ui.cards.Card) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Text(elemental2.dom.Text) Person(com.github.nalukit.example.nalu.loginapplication.client.data.model.dto.Person)

Example 2 with DataTable

use of org.dominokit.domino.ui.datatable.DataTable in project nalu-examples by NaluKit.

the class ListComponent method render.

@Override
public void render() {
    TableConfig<Person> tableConfig = new TableConfig<>();
    tableConfig.addColumn(ColumnConfig.<Person>create("name", "Name").setCellRenderer(cell -> a().textContent(cell.getTableRow().getRecord().getName() + ", " + cell.getTableRow().getRecord().getFirstName()).on(EventType.click, e -> getController().doUpdate(cell.getTableRow().getRecord())).element())).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("zip", "ZIP").textAlign("right").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getZip()))).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("city", "City").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getCity())));
    this.store = new LocalListDataStore<>();
    this.table = new DataTable<>(tableConfig, store);
    initElement(Card.create("SEARCH RESULTS").appendChild(Row.create().appendChild(Column.span12().appendChild(this.table))).element());
}
Also used : ColumnConfig(org.dominokit.domino.ui.datatable.ColumnConfig) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Elements.a(org.jboss.elemento.Elements.a) LocalListDataStore(org.dominokit.domino.ui.datatable.store.LocalListDataStore) AbstractComponent(com.github.nalukit.nalu.client.component.AbstractComponent) Column(org.dominokit.domino.ui.grid.Column) DataTable(org.dominokit.domino.ui.datatable.DataTable) ArrayList(java.util.ArrayList) Person(com.github.nalukit.example.nalu.loginapplication.shared.data.model.dto.Person) List(java.util.List) EventType(org.jboss.elemento.EventType) Text(elemental2.dom.Text) HTMLElement(elemental2.dom.HTMLElement) Row(org.dominokit.domino.ui.grid.Row) Card(org.dominokit.domino.ui.cards.Card) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Text(elemental2.dom.Text) Person(com.github.nalukit.example.nalu.loginapplication.shared.data.model.dto.Person)

Example 3 with DataTable

use of org.dominokit.domino.ui.datatable.DataTable in project nalu-examples by NaluKit.

the class ListComponent method render.

@Override
public void render() {
    TableConfig<Person> tableConfig = new TableConfig<>();
    tableConfig.addColumn(ColumnConfig.<Person>create("name", "Name").setCellRenderer(cell -> a().textContent(cell.getTableRow().getRecord().getName() + ", " + cell.getTableRow().getRecord().getFirstName()).on(EventType.click, e -> getController().doUpdate(cell.getTableRow().getRecord())).asElement())).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("zip", "ZIP").textAlign("right").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getZip()))).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("city", "City").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getCity())));
    this.store = new LocalListDataStore<>();
    this.table = new DataTable<>(tableConfig, store);
    initElement(Card.create("SEARCH RESULTS").appendChild(Row.create().appendChild(Column.span12().appendChild(this.table))).asElement());
}
Also used : ColumnConfig(org.dominokit.domino.ui.datatable.ColumnConfig) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Elements.a(org.jboss.gwt.elemento.core.Elements.a) LocalListDataStore(org.dominokit.domino.ui.datatable.store.LocalListDataStore) AbstractComponent(com.github.nalukit.nalu.client.component.AbstractComponent) Column(org.dominokit.domino.ui.grid.Column) EventType(org.jboss.gwt.elemento.core.EventType) DataTable(org.dominokit.domino.ui.datatable.DataTable) ArrayList(java.util.ArrayList) Person(com.github.nalukit.example.nalu.loginapplication.shared.data.model.dto.Person) List(java.util.List) Text(elemental2.dom.Text) HTMLElement(elemental2.dom.HTMLElement) Row(org.dominokit.domino.ui.grid.Row) Card(org.dominokit.domino.ui.cards.Card) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Text(elemental2.dom.Text) Person(com.github.nalukit.example.nalu.loginapplication.shared.data.model.dto.Person)

Example 4 with DataTable

use of org.dominokit.domino.ui.datatable.DataTable in project nalu-examples by NaluKit.

the class ListComponent method render.

@Override
public void render() {
    TableConfig<Person> tableConfig = new TableConfig<>();
    tableConfig.addColumn(ColumnConfig.<Person>create("name", "Name").setCellRenderer(cell -> a().textContent(cell.getTableRow().getRecord().getName() + ", " + cell.getTableRow().getRecord().getFirstName()).on(EventType.click, e -> getController().doUpdate(cell.getTableRow().getRecord())).element())).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("zip", "ZIP").textAlign("right").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getZip()))).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("city", "City").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getCity())));
    this.store = new LocalListDataStore<>();
    this.table = new DataTable<>(tableConfig, store);
    initElement(Card.create("SEARCH RESULTS").appendChild(Row.create().appendChild(Column.span12().appendChild(this.table))).element());
}
Also used : ColumnConfig(org.dominokit.domino.ui.datatable.ColumnConfig) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Elements.a(org.jboss.elemento.Elements.a) LocalListDataStore(org.dominokit.domino.ui.datatable.store.LocalListDataStore) AbstractComponent(com.github.nalukit.nalu.client.component.AbstractComponent) Column(org.dominokit.domino.ui.grid.Column) Person(com.github.nalukit.example.nalureusecontroller.client.data.model.dto.Person) DataTable(org.dominokit.domino.ui.datatable.DataTable) ArrayList(java.util.ArrayList) List(java.util.List) EventType(org.jboss.elemento.EventType) Text(elemental2.dom.Text) HTMLElement(elemental2.dom.HTMLElement) Row(org.dominokit.domino.ui.grid.Row) Card(org.dominokit.domino.ui.cards.Card) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Text(elemental2.dom.Text) Person(com.github.nalukit.example.nalureusecontroller.client.data.model.dto.Person)

Example 5 with DataTable

use of org.dominokit.domino.ui.datatable.DataTable in project nalu-examples by NaluKit.

the class ListComponent method render.

@Override
public void render() {
    TableConfig<Person> tableConfig = new TableConfig<>();
    tableConfig.addColumn(ColumnConfig.<Person>create("name", "Name").setCellRenderer(cell -> a().textContent(cell.getTableRow().getRecord().getName() + ", " + cell.getTableRow().getRecord().getFirstName()).on(EventType.click, e -> getController().doUpdate(cell.getTableRow().getRecord())).element())).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("zip", "ZIP").textAlign("right").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getZip()))).addColumn(ColumnConfig.<Person>create("street", "Street").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getStreet()))).addColumn(ColumnConfig.<Person>create("city", "City").setCellRenderer(cell -> new Text(cell.getTableRow().getRecord().getAddress().getCity())));
    this.store = new LocalListDataStore<>();
    this.table = new DataTable<>(tableConfig, store);
    initElement(Card.create("SEARCH RESULTS").appendChild(Row.create().appendChild(Column.span12().appendChild(this.table))).element());
}
Also used : ColumnConfig(org.dominokit.domino.ui.datatable.ColumnConfig) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Elements.a(org.jboss.elemento.Elements.a) LocalListDataStore(org.dominokit.domino.ui.datatable.store.LocalListDataStore) AbstractComponent(com.github.nalukit.nalu.client.component.AbstractComponent) Column(org.dominokit.domino.ui.grid.Column) Person(de.gishmo.example.devk.shared.model.dto.Person) DataTable(org.dominokit.domino.ui.datatable.DataTable) ArrayList(java.util.ArrayList) List(java.util.List) EventType(org.jboss.elemento.EventType) Text(elemental2.dom.Text) HTMLElement(elemental2.dom.HTMLElement) Row(org.dominokit.domino.ui.grid.Row) Card(org.dominokit.domino.ui.cards.Card) TableConfig(org.dominokit.domino.ui.datatable.TableConfig) Text(elemental2.dom.Text) Person(de.gishmo.example.devk.shared.model.dto.Person)

Aggregations

ArrayList (java.util.ArrayList)17 List (java.util.List)17 Card (org.dominokit.domino.ui.cards.Card)17 ColumnConfig (org.dominokit.domino.ui.datatable.ColumnConfig)17 DataTable (org.dominokit.domino.ui.datatable.DataTable)17 TableConfig (org.dominokit.domino.ui.datatable.TableConfig)17 LocalListDataStore (org.dominokit.domino.ui.datatable.store.LocalListDataStore)17 HTMLElement (elemental2.dom.HTMLElement)16 Elements.a (org.jboss.elemento.Elements.a)16 Icons (org.dominokit.domino.ui.icons.Icons)12 HTMLDivElement (elemental2.dom.HTMLDivElement)11 ResourceCallback (com.google.gwt.resources.client.ResourceCallback)10 ResourceException (com.google.gwt.resources.client.ResourceException)10 TextResource (com.google.gwt.resources.client.TextResource)10 DomGlobal (elemental2.dom.DomGlobal)10 HTMLTableCellElement (elemental2.dom.HTMLTableCellElement)10 Collections (java.util.Collections)10 Comparator (java.util.Comparator)10 Date (java.util.Date)10 Optional (java.util.Optional)10