Package: | Ext.grid |
Class: | CellSelectionModel |
Extends: | AbstractSelectionModel |
Defined In: | CellSelectionModel.js |
Method | Defined By | |
---|---|---|
CellSelectionModel( Object config ) |
CellSelectionModel | |
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( Boolean true ) : void |
CellSelectionModel | |
Clears all selections. | ||
fireEvent( String eventName , Object... args ) : Boolean |
Observable | |
Fires the specified event with the passed parameters (minus the event name). | ||
getSelectedCell() : Object | CellSelectionModel | |
Returns the currently selected cell,. | ||
hasListener( String eventName ) : Boolean |
Observable | |
Checks to see if this object has any listeners for a specified event | ||
hasSelection() : Boolean | CellSelectionModel | |
Returns true if there is a selection. | ||
isLocked() : Boolean | AbstractSelectionModel | |
Returns true if the selections are locked. | ||
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 | ||
select( Number rowIndex , Number collIndex ) : void |
CellSelectionModel | |
Selects a cell. | ||
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 , Number colIndex ) |
CellSelectionModel | |
Fires before a cell is selected. | ||
cellselect : ( SelectionModel this , Number rowIndex , Number colIndex ) |
CellSelectionModel | |
Fires when a cell is selected. | ||
selectionchange : ( SelectionModel this , Object selection ) |
CellSelectionModel | |
Fires when the active selection changes. |
public function CellSelectionModel( 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( Boolean true
)
true
: Booleanvoid
public function fireEvent( String eventName
, Object... args
)
eventName
: Stringargs
: Object...Boolean
public function getSelectedCell()
Object
public function hasListener( String eventName
)
eventName
: StringBoolean
public function hasSelection()
Boolean
public function isLocked()
Boolean
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 select( Number rowIndex
, Number collIndex
)
rowIndex
: NumbercollIndex
: Numbervoid
public function un( String eventName
, Function handler
, [Object scope
] )
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function unlock()
void
public event beforerowselect
this
: SelectionModelrowIndex
: NumbercolIndex
: Numberpublic event cellselect
this
: SelectionModelrowIndex
: NumbercolIndex
: Numberpublic event selectionchange
this
: SelectionModelselection
: Object