public class GridHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GridHelper.ColumnInfo<TRowObject>
Holds grid column definition.
|
private static class |
GridHelper.ResourcesAdapter
A resource adapter used to override some of the grid's css styles.
|
private static class |
GridHelper.StyleAdapter
The class provides custom css styles.
|
Constructor and Description |
---|
GridHelper() |
Modifier and Type | Method and Description |
---|---|
static <TRowObject> |
create()
Creates a new default instance of
DataGrid . |
static <TRowObject> |
initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid,
boolean multiSelection,
boolean sortable,
GridHelper.ColumnInfo<TRowObject>... columns)
Initializes an instance of
DataGrid . |
static <TRowObject> |
initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid,
boolean multiSelection,
GridHelper.ColumnInfo<TRowObject>... columns)
Initializes an instance of
DataGrid . |
static <TRowObject> |
initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid,
GridHelper.ColumnInfo<TRowObject>... columns)
Initializes an instance of
DataGrid . |
static <TRowObject> |
updateDataProvider(org.gwtbootstrap3.client.ui.gwt.DataGrid<TRowObject> dataGrid,
com.google.gwt.view.client.ListDataProvider<TRowObject> dataProvider,
TRowObject[] records)
A helper method that updates the data provider with the supplied records.
|
static <TRowObject> |
updateDataProvider(org.gwtbootstrap3.client.ui.gwt.DataGrid<TRowObject> dataGrid,
com.google.gwt.view.client.ListDataProvider<TRowObject> dataProvider,
TRowObject[] records,
com.google.gwt.regexp.shared.RegExp filterExp)
Setups the given grid data provider with new data that satisfy the given filter criteria.
|
public static <TRowObject> org.gwtbootstrap3.client.ui.gwt.DataGrid<TRowObject> create()
DataGrid
.TRowObject
- The row type.public static <TRowObject> GridHandle<TRowObject> initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid, GridHelper.ColumnInfo<TRowObject>... columns)
DataGrid
. The initialization includes creation of columns
according to the column definitions, creation of ListDataProvider
, creation of
default (single) selection model, setting up sorting and wrapping everything in
a GridHandle
which the method returns.TRowObject
- The row type.grid
- The grid to init.columns
- The column definitions.public static <TRowObject> GridHandle<TRowObject> initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid, boolean multiSelection, GridHelper.ColumnInfo<TRowObject>... columns)
DataGrid
. The initialization includes creation of columns
according to the column definitions, creation of ListDataProvider
, creation of
the selection model, setting up sorting and wrapping everything in
a GridHandle
which the method returns.TRowObject
- The row type.grid
- The grid to init.multiSelection
- Multi selection flag.columns
- The column definitions.public static <TRowObject> GridHandle<TRowObject> initListGrid(org.gwtbootstrap3.client.ui.gwt.DataGrid grid, boolean multiSelection, boolean sortable, GridHelper.ColumnInfo<TRowObject>... columns)
DataGrid
. The initialization includes creation of columns
according to the column definitions, creation of ListDataProvider
, creation of
the selection model, setting up sorting and wrapping everything in
a GridHandle
which the method returns.TRowObject
- The row type.grid
- The grid to init.multiSelection
- Multi selection flag.sortable
- Sortable flag. When false
none of the columns will be made sortable.columns
- The column definitions.public static <TRowObject> void updateDataProvider(org.gwtbootstrap3.client.ui.gwt.DataGrid<TRowObject> dataGrid, com.google.gwt.view.client.ListDataProvider<TRowObject> dataProvider, TRowObject[] records, com.google.gwt.regexp.shared.RegExp filterExp)
dataGrid
- The given griddataProvider
- The given grid data providerrecords
- The new datafilterExp
- The given filter criteriapublic static <TRowObject> void updateDataProvider(org.gwtbootstrap3.client.ui.gwt.DataGrid<TRowObject> dataGrid, com.google.gwt.view.client.ListDataProvider<TRowObject> dataProvider, TRowObject[] records)
TRowObject
- The row type.dataGrid
- The grid instance.dataProvider
- The related data provider.records
- The new records to insert into the data provider.