com.sencha.gxt.widget.core.client.grid
Class GroupingView<M>

java.lang.Object
  extended by com.sencha.gxt.widget.core.client.grid.GridView<M>
      extended by com.sencha.gxt.widget.core.client.grid.GroupingView<M>
Type Parameters:
M - the model type
All Implemented Interfaces:
CollapseItemEvent.HasCollapseItemHandlers<java.util.List<M>>, ExpandItemEvent.HasExpandItemHandlers<java.util.List<M>>
Direct Known Subclasses:
GroupSummaryView

public class GroupingView<M>
extends GridView<M>
implements CollapseItemEvent.HasCollapseItemHandlers<java.util.List<M>>, ExpandItemEvent.HasExpandItemHandlers<java.util.List<M>>

GridView that groups data based on a given grouping column.


Nested Class Summary
static class GroupingView.GroupingData<M>
           
static interface GroupingView.GroupingViewAppearance
           
static interface GroupingView.GroupingViewStyle
           
static interface GroupingView.GroupSummaryTemplate<M>
           
 
Nested classes/interfaces inherited from class com.sencha.gxt.widget.core.client.grid.GridView
GridView.GridAppearance, GridView.GridDataTableStyles, GridView.GridStyles, GridView.GridTemplates
 
Constructor Summary
GroupingView()
           
GroupingView(GroupingView.GroupingViewAppearance groupAppearance)
           
 
Method Summary
 HandlerRegistration addCollapseHandler(CollapseItemEvent.CollapseItemHandler<java.util.List<M>> handler)
          Adds a CollapseItemEvent.CollapseItemHandler handler for CollapseItemEvent events.
 HandlerRegistration addExpandHandler(ExpandItemEvent.ExpandItemHandler<java.util.List<M>> handler)
          Adds a ExpandItemEvent.ExpandItemHandler handler for ExpandItemEvent events.
 void collapseAllGroups()
          Collapses all groups.
 void expandAllGroups()
          Expands all groups.
 void groupBy(ColumnConfig<M,?> column)
           
 boolean isEnabledNoGroups()
          Returns true if the user can turn off grouping.
 boolean isEnableGroupingMenu()
          Returns true if the grouping menu is enabled.
 boolean isExpanded(Element group)
          Returns true if the group is expanded.
 boolean isShowGroupedColumn()
          Returns true if the grouped column is visible.
 boolean isStartCollapsed()
          Returns true if start collapsed is enabled.
 void setEnableGroupingMenu(boolean enableGroupingMenu)
          True to enable the the grouping menu items in the header context menu (defaults to true).
 void setEnableNoGroups(boolean enableNoGroups)
          True to enable the no groups menu item in the header context menu (defaults to true).
 void setShowGroupedColumn(boolean showGroupedColumn)
          Sets whether the grouped column is visible (defaults to true).
 void setStartCollapsed(boolean startCollapsed)
          Sets whether the groups should start collapsed (defaults to false).
 void toggleAllGroups(boolean expanded)
          Toggles all groups.
 
Methods inherited from class com.sencha.gxt.widget.core.client.grid.GridView
ensureVisible, findCell, findCellIndex, findRow, findRowIndex, focus, focusCell, focusRow, getAppearance, getAutoExpandColumn, getAutoExpandMax, getAutoExpandMin, getBody, getCell, getEditorParent, getEmptyText, getHeader, getRow, getRow, getRowBody, getRowBodyRowSpan, getScroller, getScrollState, getViewConfig, isAdjustForHScroll, isAutoFill, isColumnLines, isDeferUpdates, isEnableRowBody, isForceFit, isSelectableTarget, isShowDirtyCells, isSortingEnabled, isStripeRows, isTrackMouseOver, layout, refresh, scrollToTop, setAdjustForHScroll, setAutoExpandColumn, setAutoExpandMax, setAutoExpandMin, setAutoFill, setColumnLines, setDeferUpdates, setEmptyText, setEnableRowBody, setForceFit, setRowBodyRowSpan, setShowDirtyCells, setSortingEnabled, setStripeRows, setTrackMouseOver, setViewConfig
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupingView

public GroupingView()

GroupingView

public GroupingView(GroupingView.GroupingViewAppearance groupAppearance)
Method Detail

addCollapseHandler

public HandlerRegistration addCollapseHandler(CollapseItemEvent.CollapseItemHandler<java.util.List<M>> handler)
Description copied from interface: CollapseItemEvent.HasCollapseItemHandlers
Adds a CollapseItemEvent.CollapseItemHandler handler for CollapseItemEvent events.

Specified by:
addCollapseHandler in interface CollapseItemEvent.HasCollapseItemHandlers<java.util.List<M>>
Parameters:
handler - the handler
Returns:
the registration for the event

addExpandHandler

public HandlerRegistration addExpandHandler(ExpandItemEvent.ExpandItemHandler<java.util.List<M>> handler)
Description copied from interface: ExpandItemEvent.HasExpandItemHandlers
Adds a ExpandItemEvent.ExpandItemHandler handler for ExpandItemEvent events.

Specified by:
addExpandHandler in interface ExpandItemEvent.HasExpandItemHandlers<java.util.List<M>>
Parameters:
handler - the handler
Returns:
the registration for the event

collapseAllGroups

public void collapseAllGroups()
Collapses all groups.


expandAllGroups

public void expandAllGroups()
Expands all groups.


groupBy

public void groupBy(ColumnConfig<M,?> column)

isEnabledNoGroups

public boolean isEnabledNoGroups()
Returns true if the user can turn off grouping.

Returns:
the enable no groups state

isEnableGroupingMenu

public boolean isEnableGroupingMenu()
Returns true if the grouping menu is enabled.

Returns:
the enable grouping state

isExpanded

public boolean isExpanded(Element group)
Returns true if the group is expanded.

Parameters:
group - the group
Returns:
true if expanded

isShowGroupedColumn

public boolean isShowGroupedColumn()
Returns true if the grouped column is visible.

Returns:
the show grouped column

isStartCollapsed

public boolean isStartCollapsed()
Returns true if start collapsed is enabled.

Returns:
the start collapsed state

setEnableGroupingMenu

public void setEnableGroupingMenu(boolean enableGroupingMenu)
True to enable the the grouping menu items in the header context menu (defaults to true).

Parameters:
enableGroupingMenu - true to enable the grouping menu items

setEnableNoGroups

public void setEnableNoGroups(boolean enableNoGroups)
True to enable the no groups menu item in the header context menu (defaults to true).

Parameters:
enableNoGroups - true to enable no groups menu item

setShowGroupedColumn

public void setShowGroupedColumn(boolean showGroupedColumn)
Sets whether the grouped column is visible (defaults to true).

Parameters:
showGroupedColumn - true to show the grouped column

setStartCollapsed

public void setStartCollapsed(boolean startCollapsed)
Sets whether the groups should start collapsed (defaults to false).

Parameters:
startCollapsed - true to start collapsed

toggleAllGroups

public void toggleAllGroups(boolean expanded)
Toggles all groups.

Parameters:
expanded - true to expand


Copyright © 2012. All Rights Reserved.