Package: | Ext.grid |
Class: | RowSelectionModel |
Extends: | AbstractSelectionModel |
Defined In: | RowSelectionModel.js |
Method | Defined By | |
---|---|---|
RowSelectionModel(Object config ) |
RowSelectionModel | |
addEvents(Object object ) : void |
Observable | |
Copies any events from the passed object onto this object if they do not already exist. The passed object must also ... | ||
addListener(String eventName , Function handler , [Object scope ], [Object options ]) : void |
Observable | |
Appends an event handler to this component | ||
clearSelections() : void | RowSelectionModel | |
Clears all selections. | ||
deselectRange(Number startRow , Number endRow ) : void |
RowSelectionModel | |
Deselects a range of rows. All rows in between startRow and endRow are also deselected. | ||
deselectRow(Number row ) : void |
RowSelectionModel | |
Deselects a row. | ||
fireEvent(String eventName , Object... args ) : Boolean |
Observable | |
Fires the specified event with the passed parameters (minus the event name). | ||
getCount() : Number | RowSelectionModel | |
Gets the number of selected rows. | ||
getSelected() : Record | RowSelectionModel | |
Returns the first selected record. | ||
getSelections() : Array | RowSelectionModel | |
Returns the selected records | ||
hasListener(String eventName ) : Boolean |
Observable | |
Checks to see if this object is currently listening for a specified event | ||
hasSelection() : Boolean | RowSelectionModel | |
Returns True if there is a selection. | ||
isIdSelected(String id ) : Boolean |
RowSelectionModel | |
Returns True if the specified record id is selected. | ||
isLocked() : Boolean | AbstractSelectionModel | |
Returns true if the selections are locked | ||
isSelected(Number/Record record ) : Boolean |
RowSelectionModel | |
Returns True if the specified row is selected. | ||
lock() : void | AbstractSelectionModel | |
Lock the selections | ||
on(String eventName , Function handler , [Object options ]) : void |
Observable | |
Appends an event handler to this element (shorthand for addListener) | ||
purgeListeners() : void | Observable | |
Removes all listeners for this object | ||
removeListener(String eventName , Function handler , [Object scope ]) : void |
Observable | |
Removes a listener | ||
selectAll() : void | RowSelectionModel | |
Selects all rows. | ||
selectFirstRow() : void | RowSelectionModel | |
Selects the first row in the grid. | ||
selectLastRow([Boolean keepExisting ]) : void |
RowSelectionModel | |
Select the last row. | ||
selectNext([Boolean keepExisting ]) : void |
RowSelectionModel | |
Selects the row immediately following the last selected row. | ||
selectPrevious([Boolean keepExisting ]) : void |
RowSelectionModel | |
Selects the row that precedes the last selected row. | ||
selectRange(Number startRow , Number endRow , [Boolean keepExisting ]) : void |
RowSelectionModel | |
Selects a range of rows. All rows in between startRow and endRow are also selected. | ||
selectRecords(Array records , [Boolean keepExisting ]) : void |
RowSelectionModel | |
Select records. | ||
selectRow(Number row , [Boolean keepExisting ]) : void |
RowSelectionModel | |
Selects a row. | ||
selectRows(Array rows , [Boolean keepExisting ]) : void |
RowSelectionModel | |
Selects multiple rows. | ||
un(String eventName , Function handler , [Object scope ]) : void |
Observable | |
Removes a listener (shorthand for removeListener) | ||
unlock() : void | AbstractSelectionModel | |
Unlock the selections |
Event | Defined By | |
---|---|---|
beforerowselect : (SelectionModel this , Number rowIndex ) |
RowSelectionModel | |
Fires when a row is selected being selected, return false to cancel. | ||
rowselect : (SelectionModel this , Number rowIndex ) |
RowSelectionModel | |
Fires when a row is selected. | ||
selectionchange : (SelectionModel this ) |
RowSelectionModel | |
Fires when the selection changes |
Config Options | Defined By | |
---|---|---|
singleSelect : Boolean | RowSelectionModel | |
True to allow selection of only one row at a time (defaults to false) |
public function RowSelectionModel(Object config
)
config
: Objectpublic function addEvents(Object object
)
object
: Objectvoid
public function addListener(String eventName
, Function handler
, [Object scope
], [Object options
])
eventName
: Stringhandler
: Functionscope
: Objectoptions
: Object Combining Options
Using the options argument, it is possible to combine different types of listeners:
A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 });
The method also allows for a single argument to be passed which is a config object containing properties which specify multiple handlers.
Attaching multiple handlers in 1 call
Code:
el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } });
Or a shorthand syntax:
Code:
el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });
void
public function clearSelections()
void
public function deselectRange(Number startRow
, Number endRow
)
startRow
: NumberendRow
: Numbervoid
public function deselectRow(Number row
)
row
: Numbervoid
public function fireEvent(String eventName
, Object... args
)
eventName
: Stringargs
: Object...Boolean
public function getCount()
Number
public function getSelected()
Record
public function getSelections()
Array
public function hasListener(String eventName
)
eventName
: StringBoolean
public function hasSelection()
Boolean
public function isIdSelected(String id
)
id
: StringBoolean
public function isLocked()
Boolean
public function isSelected(Number/Record record
)
record
: Number/RecordBoolean
public function lock()
void
public function on(String eventName
, Function handler
, [Object options
])
eventName
: Stringhandler
: Functionoptions
: Objectvoid
public function purgeListeners()
void
public function removeListener(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function selectAll()
void
public function selectFirstRow()
void
public function selectLastRow([Boolean keepExisting
])
keepExisting
: Booleanvoid
public function selectNext([Boolean keepExisting
])
keepExisting
: Booleanvoid
public function selectPrevious([Boolean keepExisting
])
keepExisting
: Booleanvoid
public function selectRange(Number startRow
, Number endRow
, [Boolean keepExisting
])
startRow
: NumberendRow
: NumberkeepExisting
: Booleanvoid
public function selectRecords(Array records
, [Boolean keepExisting
])
records
: ArraykeepExisting
: Booleanvoid
public function selectRow(Number row
, [Boolean keepExisting
])
row
: NumberkeepExisting
: Booleanvoid
public function selectRows(Array rows
, [Boolean keepExisting
])
rows
: ArraykeepExisting
: Booleanvoid
public function un(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function unlock()
void
public event beforerowselect
this
: SelectionModelrowIndex
: Numberpublic event rowselect
this
: SelectionModelrowIndex
: Numberpublic event selectionchange
this
: SelectionModel