com.extjs.gxt.ui.client.widget.selection
Interface StoreSelectionModel<M extends ModelData>

Type Parameters:
M - the model type
All Known Implementing Classes:
AbstractStoreSelectionModel, CellSelectionModel, CellTreeGridSelectionModel, CheckBoxSelectionModel, GridSelectionModel, ListViewSelectionModel, TreeGridSelectionModel, TreePanelSelectionModel

public interface StoreSelectionModel<M extends ModelData>

Defines the interface for store based selection models.

The selection model supports 3 different selection modes:


Method Summary
 void bind(Store store)
          Binds the store to the selection model.
 void deselect(int index)
          Deselects the item at the given index.
 void deselect(int start, int end)
          Deselects the range.
 void deselect(java.util.List<M> items)
          Deselects the items.
 void deselect(M... items)
          Deselects the items.
 void deselect(M item)
          Deselects the item.
 void deselectAll()
          Deselects all selections.
 M getSelectedItem()
          Returns the selected item.
 java.util.List<M> getSelectedItems()
          Returns the selected items.
 Style.SelectionMode getSelectionMode()
          Returns the selection mode.
 boolean isSelected(M item)
          Returns true if the item is selected.
 void refresh()
          Refreshes the current selections.
 void select(boolean keepExisting, M... items)
          Selects the items.
 void select(int index, boolean keepExisting)
          Selects the item at the given index.
 void select(int start, int end, boolean keepExisting)
          Selects the range.
 void select(java.util.List<M> items, boolean keepExisting)
          Selects the items.
 void select(M item, boolean keepExisting)
          Selects the item.
 void selectAll()
          Selects all items.
 void setSelectionMode(Style.SelectionMode selectionMode)
          Sets the selection mode.
 

Method Detail

bind

void bind(Store store)
Binds the store to the selection model.

Parameters:
store - the bound store

deselect

void deselect(int index)
Deselects the item at the given index.

Parameters:
index - the index of the item to be deselected

deselect

void deselect(int start,
              int end)
Deselects the range.

Parameters:
start - the start index
end - the end index

deselect

void deselect(java.util.List<M> items)
Deselects the items.

Parameters:
items - the item

deselect

void deselect(M... items)
Deselects the items.

Parameters:
items - the items to deselect

deselect

void deselect(M item)
Deselects the item.

Parameters:
item - the item to be deselected

deselectAll

void deselectAll()
Deselects all selections.


getSelectedItem

M getSelectedItem()
Returns the selected item.


getSelectedItems

java.util.List<M> getSelectedItems()
Returns the selected items.


getSelectionMode

Style.SelectionMode getSelectionMode()
Returns the selection mode.

Returns:
the selection mode

isSelected

boolean isSelected(M item)
Returns true if the item is selected.

Parameters:
item - the item
Returns:
true if selected

refresh

void refresh()
Refreshes the current selections.


select

void select(int index,
            boolean keepExisting)
Selects the item at the given index.

Parameters:
index - the index of the item to be selected
keepExisting - true to keep existing selected

select

void select(int start,
            int end,
            boolean keepExisting)
Selects the range.

Parameters:
start - the start index
end - the end index
keepExisting - true to keep existing selected

select

void select(java.util.List<M> items,
            boolean keepExisting)
Selects the items. Selects the first item for single-select.

Parameters:
items - the items to select
keepExisting - true to keep existing selected

select

void select(boolean keepExisting,
            M... items)
Selects the items. Selects the first item for single-select.

Parameters:
keepExisting - true to keep existing selected
items - the items

select

void select(M item,
            boolean keepExisting)
Selects the item.

Parameters:
item - the item
keepExisting - true to keep existing selected

selectAll

void selectAll()
Selects all items.


setSelectionMode

void setSelectionMode(Style.SelectionMode selectionMode)
Sets the selection mode.

The selection model supports 3 different selection modes:

Parameters:
selectionMode - the selection mode