com.extjs.gxt.ui.client.widget.grid
Class AggregationRowConfig<M extends ModelData>

java.lang.Object
  extended by com.extjs.gxt.ui.client.widget.grid.AggregationRowConfig<M>
Type Parameters:
M - the model type

public class AggregationRowConfig<M extends ModelData>
extends java.lang.Object

Defines the configuration information for an aggregation row. The values for each column can be configured and calculated in several ways. The following methods are supported in order of precedence.

  1. A static HTML string can be specified.
  2. A widget can be specified.
  3. A SummaryType can be used to "calculate" a value based on the data. When using a summary type, EITHER a NumberFormat or a AggregationRenderer can be used to "format" the value.

In some cases, the values will not be calculated by the data stored in the store, for example, with paging. In this situation, there are 2 ways to provide values.

The first method is to specify a AggregationRenderer for the relevant columns. This renderer can any data as needed. The second method is to provide a GXT Model that contains the values for the aggregation row. In this case, the value will be retrieved from the model using the property name associated with the column. With this method, you are responsible for ensuring the model is updated any time the aggregation values are updated.


Constructor Summary
AggregationRowConfig()
          Creates a new aggregation row config.s
 
Method Summary
 java.lang.String getCellStyle(java.lang.String id)
          Returns the cell style for the given column.
 java.lang.String getHtml(java.lang.String id)
          Returns the html for the given column.
 ModelData getModel()
          Returns the model.
 AggregationRenderer<M> getRenderer(java.lang.String id)
          Returns the aggregation renderer for the given column.
 com.google.gwt.i18n.client.NumberFormat getSummaryFormat(java.lang.String id)
          Returns the summary format for the given column.
 SummaryType<?> getSummaryType(java.lang.String id)
          Returns the summary type for the given column.
 com.google.gwt.user.client.ui.Widget getWidget(java.lang.String id)
          Returns the widget for the given column.
 void setCellStyle(java.lang.String id, java.lang.String style)
          Sets the cell style for the given column.
 void setHtml(java.lang.String id, java.lang.String html)
          Sets the static HTML for the given column.
 void setModel(ModelData model)
          Sets the model that contains the values for the aggregation row.
 void setRenderer(java.lang.String id, AggregationRenderer<M> renderer)
          Sets the aggregation renderer for the given column.
 void setSummaryFormat(java.lang.String id, com.google.gwt.i18n.client.NumberFormat format)
          Sets the number format for the given column.
 void setSummaryType(java.lang.String id, SummaryType<?> type)
          Sets the summary type for the given column.
 void setWidget(java.lang.String id, com.google.gwt.user.client.ui.Widget widget)
          Sets the widget for the given column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationRowConfig

public AggregationRowConfig()
Creates a new aggregation row config.s

Method Detail

getCellStyle

public java.lang.String getCellStyle(java.lang.String id)
Returns the cell style for the given column.

Parameters:
id - the column id
Returns:
the CSS style name

getHtml

public java.lang.String getHtml(java.lang.String id)
Returns the html for the given column.

Parameters:
id - the column id
Returns:
the column

getModel

public ModelData getModel()
Returns the model.

Returns:
the model

getRenderer

public AggregationRenderer<M> getRenderer(java.lang.String id)
Returns the aggregation renderer for the given column.

Parameters:
id - the column id
Returns:
the aggregation renderer

getSummaryFormat

public com.google.gwt.i18n.client.NumberFormat getSummaryFormat(java.lang.String id)
Returns the summary format for the given column.

Parameters:
id - the column id
Returns:
the summary format

getSummaryType

public SummaryType<?> getSummaryType(java.lang.String id)
Returns the summary type for the given column.

Parameters:
id - the column id
Returns:
the summary type

getWidget

public com.google.gwt.user.client.ui.Widget getWidget(java.lang.String id)
Returns the widget for the given column.

Parameters:
id - the column id
Returns:
the widget

setCellStyle

public void setCellStyle(java.lang.String id,
                         java.lang.String style)
Sets the cell style for the given column.

Parameters:
id - the column id
style - the CSS style name

setHtml

public void setHtml(java.lang.String id,
                    java.lang.String html)
Sets the static HTML for the given column.

Parameters:
id - the column id
html - the html

setModel

public void setModel(ModelData model)
Sets the model that contains the values for the aggregation row. It is expected, the model contains a value for the properties which match the column configuration data index. If the value is a Number, the number format and renderer will be used if specified. toString will be called on any other type.

Parameters:
model - the model

setRenderer

public void setRenderer(java.lang.String id,
                        AggregationRenderer<M> renderer)
Sets the aggregation renderer for the given column.

Parameters:
id - the column id
renderer - the renderer

setSummaryFormat

public void setSummaryFormat(java.lang.String id,
                             com.google.gwt.i18n.client.NumberFormat format)
Sets the number format for the given column. Only applies when specifying a SummaryType.

Parameters:
id - the column id
format - the number format

setSummaryType

public void setSummaryType(java.lang.String id,
                           SummaryType<?> type)
Sets the summary type for the given column.

Parameters:
id - the column id
type - the summary type

setWidget

public void setWidget(java.lang.String id,
                      com.google.gwt.user.client.ui.Widget widget)
Sets the widget for the given column.

Parameters:
id - the column id
widget - the widget