国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

Gird事件機制初級讀本

2024-09-06 12:42:59
字體:
來源:轉載
供稿:網友

原文地址 文章日期:2006/09/25/

 新版.32 的YUI-EXT包含了GIRD事件機制的重要升級。許多新事件現在可以用了,監聽事件的機制也改變了(盡管它仍然向后兼容)。

偵聽事件的方法

鑒于 YAHOO.util.CustomEvent只提供簡單的訪問,Grid和相關的對象擴展了新的方法來偵聽事件,這些事件你應該是熟悉的。它們是:

addListener(eventName, fn, scope, override) - "eventName" should be one of the events defined below. "fn" is the function to call when the event occurs. "scope" is an optional object providing the scope (this) of the function. "override" is whether or not to apply that scope and is only there for backwards compatibility. removeListener(eventName, fn, scope) -移除前先提交的事件偵聽 on(eventName, fn, scope, override) - addListener 快捷方式

這些方法與YAHOO.uitl.Event一樣,有相同的署名(signatures)。

onRowSelect事件的偵聽:

var sm = grid.getSelectionModel(); sm.addListener('rowselect', myHandler);

這是GIRD暴露事件的列表和參數簡介:

- "this" 指的是Grid對象; - "e" 指的是 YAHOO.ext.EventObject (常規化事件對象) ,除了Drag & Drop對象是標準瀏覽器事件對象。- "dd" 指的是Grid的YAHOO.ext.GridDD對象。

譯注:下面事件解釋以原文方式提供以便讀者準確理解:

cellclick - (this, rowIndex, columnIndex, e) - Fires when a cell is clicked celldblclick - (this, rowIndex, columnIndex, e) - Fires when a cell is double clicked rowclick - (this, rowIndex, e) - Fires when a row is clicked rowdblclick - (this, rowIndex, e) - Fires when a row is double clicked headerclick - (this, columnIndex, e) - Fires when a header is clicked rowcontextmenu - (this, rowIndex, e) - Fires when a row is right clicked headercontextmenu - (this, columnIndex, e) - Fires when a header is right clicked beforeedit - (this, rowIndex, columnIndex, e) - Fires just before editing is started on a cell afteredit - (this, rowIndex, columnIndex, e) - Fires immediately after a cell is edited bodyscroll - (scrollLeft, scrollTop) - Fires when the grid's body is scrolled columnresize - (columnIndex, newSize) Fires when the user resizes a column. startdrag - (this, dd, e) - Fires when row(s) start being dragged enddrag - (this, dd, e) - Fires when a drag operation is complete dragdrop - (this, dd, targetId, e) - Fires when dragged row(s) are dropped on a valid DD target dragover - (this, dd, targetId, e) Fires while row(s) are being dragged. "targetId" is the id of the Yahoo.util.DD object the selected rows are being dragged over. dragenter - (this, dd, targetId, e) - Fires when the dragged row(s) first cross another DD target while being dragged dragout - (this, dd, targetId, e) - Fires when the dragged row(s) leave another DD target while being dragged
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 孙吴县| 澄江县| 京山县| 蛟河市| 永新县| 额尔古纳市| 洪雅县| 垦利县| 西充县| 麻阳| 呼图壁县| 西乡县| 桐梓县| 石首市| 惠安县| 策勒县| 从化市| 星子县| 平山县| 景德镇市| 曲周县| 永靖县| 虹口区| 开平市| 芮城县| 德化县| 辽宁省| 鹰潭市| 三河市| 嘉义市| 青海省| 双峰县| 十堰市| 中山市| 乌海市| 合江县| 西吉县| 集安市| 会昌县| 巨鹿县| 萨嘎县|