| Package: | Ext.grid |
| Class: | RowSelectionModel |
| Extends: | AbstractSelectionModel |
| Defined In: | RowSelectionModel.js |
| 方法 | 定义对象 | |
|---|---|---|
RowSelectionModel(Object config) |
RowSelectionModel | |
addEvents(Object object) : void |
Observable | |
| 将对象中没有的事件从给出的对象中复制过来。 | ||
addListener(String eventName, Function handler, [Object scope], [Object options]) : void |
Observable | |
| 为该组件加入事件处理器函数 | ||
| 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 | |
| 触发指定的事件, 并将参数传入(至少要有事件名称)。 | ||
| 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 | |
| 检查该对象是否拥有指定事件的侦听器 | ||
| 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 | |
| 为该组件加入事件处理器函数, addListener 的简写方式 | ||
| purgeListeners() : void | Observable | |
| 从对象身上移除所有的侦听器 | ||
removeListener(String eventName, Function handler, [Object scope]) : void |
Observable | |
| 移除侦听器 | ||
| 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 | |
| 移除侦听器, removeListener 的简写方式 | ||
| unlock() : void | AbstractSelectionModel | |
| Unlock the selections | ||
| 事件 | 定义对象 | |
|---|---|---|
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 | ||
| 设置选项 | 定义对象 | |
|---|---|---|
| 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 : Objectvoidpublic function addListener(String eventName, Function handler, [Object scope], [Object options])
eventName : Stringhandler : Functionscope : Objectoptions : Object
组合选项
使用选项参数可以组合不同类型的监听器:
下面是一个标准的、延迟执行的、一次性的监听器,将会自动停止事件并传递一个自定义的参数(forumId)
el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 }); 这个方法也允许传递的单个参数是一个包含多个指定处理函数的设置对象。
一次调用多个处理函数
代码:
el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } }); 或者简写为:
代码:
el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });
voidpublic function clearSelections()
voidpublic function deselectRange(Number startRow, Number endRow)
startRow : NumberendRow : Numbervoidpublic function deselectRow(Number row)
row : Numbervoidpublic function fireEvent(String eventName, Object... args)
eventName : Stringargs : Object...Booleanpublic function getCount()
Numberpublic function getSelected()
Recordpublic function getSelections()
Arraypublic function hasListener(String eventName)
eventName : StringBooleanpublic function hasSelection()
Booleanpublic function isIdSelected(String id)
id : StringBooleanpublic function isLocked()
Booleanpublic function isSelected(Number/Record record)
record : Number/RecordBooleanpublic function lock()
voidpublic function on(String eventName, Function handler, [Object options])
eventName : Stringhandler : Functionoptions : Objectvoidpublic function purgeListeners()
voidpublic function removeListener(String eventName, Function handler, [Object scope])
eventName : Stringhandler : Functionscope : Objectvoidpublic function selectAll()
voidpublic function selectFirstRow()
voidpublic function selectLastRow([Boolean keepExisting])
keepExisting : Booleanvoidpublic function selectNext([Boolean keepExisting])
keepExisting : Booleanvoidpublic function selectPrevious([Boolean keepExisting])
keepExisting : Booleanvoidpublic function selectRange(Number startRow, Number endRow, [Boolean keepExisting])
startRow : NumberendRow : NumberkeepExisting : Booleanvoidpublic function selectRecords(Array records, [Boolean keepExisting])
records : ArraykeepExisting : Booleanvoidpublic function selectRow(Number row, [Boolean keepExisting])
row : NumberkeepExisting : Booleanvoidpublic function selectRows(Array rows, [Boolean keepExisting])
rows : ArraykeepExisting : Booleanvoidpublic function un(String eventName, Function handler, [Object scope])
eventName : Stringhandler : Functionscope : Objectvoidpublic function unlock()
voidpublic event beforerowselect
this : SelectionModelrowIndex : Numberpublic event rowselect
this : SelectionModelrowIndex : Numberpublic event selectionchange
this : SelectionModel