| Package: | Ext.grid |
| Class: | EditorGrid |
| Extends: | Grid |
| Defined In: | EditorGrid.js |
| 属性 | 定义对象 | |
|---|---|---|
| ddText : String | Grid | |
| Configures the text is the drag proxy (defaults to "%0 selected row(s)"). %0 is replaced with the number of selected ... | ||
| 方法 | 定义对象 | |
|---|---|---|
addEvents(Object object) : void |
Observable | |
| 将对象中没有的事件从给出的对象中复制过来。 | ||
addListener(String eventName, Function handler, [Object scope], [Object options]) : void |
Observable | |
| 为该组件加入事件处理器函数 | ||
| autoSize() : void | Grid | |
| Causes the grid to manually recalculate its dimensions. Generally this is done automatically, but if manual update is... | ||
destroy(Boolean removeEl) : void |
Grid | |
| Destroy this grid. | ||
fireEvent(String eventName, Object... args) : Boolean |
Observable | |
| 触发指定的事件, 并将参数传入(至少要有事件名称)。 | ||
| getColumnModel() : ColumnModel | Grid | |
| Returns the grid's ColumnModel. | ||
| getDataSource() : DataSource | Grid | |
| Returns the grid's DataSource. | ||
| getDragDropText() : String | Grid | |
| Called to get grid's drag proxy text, by default returns this.ddText. | ||
| getSelectionModel() : SelectionModel | Grid | |
| Returns the grid's SelectionModel. | ||
| getView() : GridView | Grid | |
| Returns the grid's GridView object. | ||
hasListener(String eventName) : Boolean |
Observable | |
| 检查该对象是否拥有指定事件的侦听器 | ||
on(String eventName, Function handler, [Object options]) : void |
Observable | |
| 为该组件加入事件处理器函数, addListener 的简写方式 | ||
| purgeListeners() : void | Observable | |
| 从对象身上移除所有的侦听器 | ||
removeListener(String eventName, Function handler, [Object scope]) : void |
Observable | |
| 移除侦听器 | ||
| render() : Ext.grid.Grid | Grid | |
| * Called once after all setup has been completed and the grid is ready to be rendered. | ||
startEditing(Number rowIndex, Number colIndex) : void |
EditorGrid | |
| Starts editing the specified for the specified row/column | ||
| stopEditing() : void | EditorGrid | |
| Stops any active editing | ||
un(String eventName, Function handler, [Object scope]) : void |
Observable | |
| 移除侦听器, removeListener 的简写方式 | ||
| 事件 | 定义对象 | |
|---|---|---|
afteredit : (Object e) |
EditorGrid | |
| Fires after a cell is edited. grid - This grid record - The record being edited field - The field name being edited... | ||
beforeedit : (Object e) |
EditorGrid | |
| Fires before cell editing is triggered. The edit event object has the following properties grid - This grid record ... | ||
bodyscroll : (Number scrollLeft, Number scrollTop) |
Grid | |
| Fires when the body element is scrolled | ||
cellclick : (Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e) |
Grid | |
| Fires when a cell is clicked | ||
cellcontextmenu : (Grid this, Number rowIndex, Number cellIndex, Ext.EventObject e) |
Grid | |
| Fires when a cell is right clicked | ||
celldblclick : (Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e) |
Grid | |
| Fires when a cell is double clicked | ||
click : (Ext.EventObject e) |
Grid | |
| The raw click event for the entire grid. | ||
columnmove : (Number oldIndex, Number newIndex) |
Grid | |
| Fires when the user moves a column | ||
columnresize : (Number columnIndex, Number newSize) |
Grid | |
| Fires when the user resizes a column | ||
contextmenu : (Ext.EventObject e) |
Grid | |
| The raw contextmenu event for the entire grid. | ||
dblclick : (Ext.EventObject e) |
Grid | |
| The raw dblclick event for the entire grid. | ||
dragdrop : (Grid this, Ext.GridDD dd, String targetId, event e) |
Grid | |
| Fires when dragged row(s) are dropped on a valid DD target | ||
dragenter : (Grid this, Ext.GridDD dd, String targetId, event e) |
Grid | |
| Fires when the dragged row(s) first cross another DD target while being dragged | ||
dragout : (Grid this, Ext.GridDD dd, String targetId, event e) |
Grid | |
| Fires when the dragged row(s) leave another DD target while being dragged | ||
dragover : (Grid this, Ext.GridDD dd, String targetId, event e) |
Grid | |
| Fires while row(s) are being dragged. "targetId" is the id of the Yahoo.util.DD object the selected rows are being dr... | ||
enddrag : (Grid this, Ext.GridDD dd, event e) |
Grid | |
| Fires when a drag operation is complete | ||
headerclick : (Grid this, Number columnIndex, Ext.EventObject e) |
Grid | |
| Fires when a header is clicked | ||
headercontextmenu : (Grid this, Number columnIndex, Ext.EventObject e) |
Grid | |
| Fires when a header is right clicked | ||
headerdblclick : (Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e) |
Grid | |
| Fires when a header cell is double clicked | ||
keydown : (Ext.EventObject e) |
Grid | |
| The raw keydown event for the entire grid. | ||
keypress : (Ext.EventObject e) |
Grid | |
| The raw keypress event for the entire grid. | ||
mousedown : (Ext.EventObject e) |
Grid | |
| The raw mousedown event for the entire grid. | ||
mouseout : (Ext.EventObject e) |
Grid | |
| The raw mouseout event for the entire grid. | ||
mouseover : (Ext.EventObject e) |
Grid | |
| The raw mouseover event for the entire grid. | ||
mouseup : (Ext.EventObject e) |
Grid | |
| The raw mouseup event for the entire grid. | ||
rowclick : (Grid this, Number rowIndex, Ext.EventObject e) |
Grid | |
| Fires when a row is clicked | ||
rowcontextmenu : (Grid this, Number rowIndex, Ext.EventObject e) |
Grid | |
| Fires when a row is right clicked | ||
rowdblclick : (Grid this, Number rowIndex, Ext.EventObject e) |
Grid | |
| Fires when a row is double clicked | ||
startdrag : (Grid this, Ext.GridDD dd, event e) |
Grid | |
| Fires when row(s) start being dragged | ||
validateedit : (Object e) |
EditorGrid | |
| Fires after a cell is edited, but before the value is set in the record. Return false to cancel the change. The edit ... | ||
| 设置选项 | 定义对象 | |
|---|---|---|
| A : Object | Grid | |
javascript RegExp defining tagNames allowed to have text selection (Defaults to /INPUT|TEXTAREA|SELECT/i). |
||
| An : Object | Grid | |
| Ext.LoadMask config or true to mask the grid while loading (defaults to false). | ||
| If : Boolean | Grid | |
| autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size - defa... | ||
| The : Object | Grid | |
| Ext.grid.GridView used by the grid. This can be set before a call to render(). | ||
| True : Boolean | Grid | |
| to fit the height of the grid container to the height of the data. Defaults to false. | ||
public String ddText
public 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 autoSize()
voidpublic function destroy(Boolean removeEl)
removeEl : Booleanvoidpublic function fireEvent(String eventName, Object... args)
eventName : Stringargs : Object...Booleanpublic function getColumnModel()
ColumnModelpublic function getDataSource()
DataSourcepublic function getDragDropText()
Stringpublic function getSelectionModel()
SelectionModelpublic function getView()
GridViewpublic function hasListener(String eventName)
eventName : StringBooleanpublic 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 render()
Ext.grid.Gridpublic function startEditing(Number rowIndex, Number colIndex)
rowIndex : NumbercolIndex : Numbervoidpublic function stopEditing()
voidpublic function un(String eventName, Function handler, [Object scope])
eventName : Stringhandler : Functionscope : Objectvoidpublic event afteredit
e : Objectpublic event beforeedit
e : Objectpublic event bodyscroll
scrollLeft : NumberscrollTop : Numberpublic event cellclick
this : GridrowIndex : NumbercolumnIndex : Numbere : Ext.EventObjectpublic event cellcontextmenu
this : GridrowIndex : NumbercellIndex : Numbere : Ext.EventObjectpublic event celldblclick
this : GridrowIndex : NumbercolumnIndex : Numbere : Ext.EventObjectpublic event click
e : Ext.EventObjectpublic event columnmove
oldIndex : NumbernewIndex : Numberpublic event columnresize
columnIndex : NumbernewSize : Numberpublic event contextmenu
e : Ext.EventObjectpublic event dblclick
e : Ext.EventObjectpublic event dragdrop
this : Griddd : Ext.GridDDtargetId : Stringe : eventpublic event dragenter
this : Griddd : Ext.GridDDtargetId : Stringe : eventpublic event dragout
this : Griddd : Ext.GridDDtargetId : Stringe : eventpublic event dragover
this : Griddd : Ext.GridDDtargetId : Stringe : eventpublic event enddrag
this : Griddd : Ext.GridDDe : eventpublic event headerclick
this : GridcolumnIndex : Numbere : Ext.EventObjectpublic event headercontextmenu
this : GridcolumnIndex : Numbere : Ext.EventObjectpublic event headerdblclick
this : GridrowIndex : NumbercolumnIndex : Numbere : Ext.EventObjectpublic event keydown
e : Ext.EventObjectpublic event keypress
e : Ext.EventObjectpublic event mousedown
e : Ext.EventObjectpublic event mouseout
e : Ext.EventObjectpublic event mouseover
e : Ext.EventObjectpublic event mouseup
e : Ext.EventObjectpublic event rowclick
this : GridrowIndex : Numbere : Ext.EventObjectpublic event rowcontextmenu
this : GridrowIndex : Numbere : Ext.EventObjectpublic event rowdblclick
this : GridrowIndex : Numbere : Ext.EventObjectpublic event startdrag
this : Griddd : Ext.GridDDe : eventpublic event validateedit
e : ObjectA : Object
/INPUT|TEXTAREA|SELECT/i). An : Object
If : Boolean
The : Object
True : Boolean