Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个道场网格,当按下“ENTER”键时,我想在其上执行一些操作。但是,我只想添加 DOJO 在按下某个键时已经执行的操作。当我尝试使用处理程序时,它会替换 dojox.grid._Events 中的 onKeyDown 函数,而不是添加到它。有什么方法可以确保在我的处理函数中添加之前调用 _Events 函数?
您可以连接到网格对象上的 onKeyPress 函数。例如:
var grid = dijit.byId('myGrid'); dojo.connect( grid, "onKeyPress", function(evt) { if(evt.keyCode === dojo.keys.ENTER) { console.log('ENTER!'); } });
该类dojox.grid._Grid(它是所有网格的父类)是从扩展而来的,dojox.grid._Events因此所有这些方法都可用于连接。
dojox.grid._Grid
dojox.grid._Events