Package: | Ext.grid |
Class: | RowSelectionModel |
Extends: | AbstractSelectionModel |
Defined In: | RowSelectionModel.js |
Method | Defined By | |
---|---|---|
RowSelectionModel( Object config ) |
RowSelectionModel | |
addEvents( Object object ) : void |
Observable | |
Used to define events on this Observable | ||
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 has any listeners 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 | |
Locks the selections. | ||
on( String eventName , Function handler , [Object scope ], [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 | |
Unlocks the selections. |
Event | Defined By | |
---|---|---|
beforerowselect : ( SelectionModel this , Number rowIndex , Boolean keepExisting ) |
RowSelectionModel | |
Fires when a row is selected being selected, return false to cancel. | ||
rowdeselect : ( SelectionModel this , Number rowIndex ) |
RowSelectionModel | |
Fires when a row is deselected. | ||
rowselect : ( SelectionModel this , Number rowIndex , Ext.data.Record r ) |
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,
forumId: 4
});
Attaching multiple handlers in 1 call
The method also allows for a single argument to be passed which is a config object containing properties
which specify multiple handlers.
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 which passes the same scope object to all handlers:
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 scope
], [Object options
] )
eventName
: Stringhandler
: Functionscope
: Objectoptions
: 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
: NumberkeepExisting
: Booleanpublic event rowdeselect
this
: SelectionModelrowIndex
: Numberpublic event rowselect
this
: SelectionModelrowIndex
: Numberr
: Ext.data.Recordpublic event selectionchange
this
: SelectionModel