onMouseOverRow事件无法正常工作 [英] The onMouseOverRow event not working

查看:84
本文介绍了onMouseOverRow事件无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个应用程序中,数据(几十行)填充DataGrid,如下所述。在这段代码中,我想使用onMouseOverRow事件来检索鼠标在其上的行上的数据。但是,我得到的错误是:e.rowIndex未定义。我的代码有什么问题?感谢您分享您的经验。

< table dojotype =   dojox.grid.DataGrid id =   grid2 noDataMessage = < span class =code-string> 在当前地图范围内找不到结果 style =    height:250px; overflow:auto; font-size:smaller; selectionMode =   single> 
< thead>
< tr>
< th field = OID width = 25px> Id < / th >
< th field = STATION width = 100px>位置网站< / th >
< th field = ADDRESS width = 180px> Address < / th >
< / tr >
< ; / thead >
< /
table >
...
function ShowItemFromGrid(e){
var k = e .rowIndex;
}

解决方案

dojo中的偶数绑定的工作方式如下:

 dojo.addOnLoad( function (){
dojo.connect(grid2, onMouseOverRow null ,ShowItemFromGrid);
});


In one of my application, the data (dozens of rows) are populated the DataGrid as defined below. In this piece of code, I want to use the onMouseOverRow event to retrieve the data on the row the mouse is over on it. However, I got the error that: e.rowIndex not defined. What's wrong in my code? Thanks for you to share your experience.

<table dojotype="dojox.grid.DataGrid" id="grid2" noDataMessage="No results found in the current map extent" style="height:250px; overflow:auto; font-size:smaller;" selectionMode="single" >
 <thead>
   <tr>
	<th field="OID" width=25px >Id</th>
        <th field="STATION" width=100px  >Location Site</th>
        <th field="ADDRESS"  width=180px          >Address</th>
   </tr>
 </thead>
</table>
...
function ShowItemFromGrid(e) {
   var k = e.rowIndex;
}

解决方案

The even binding in dojo works like this:

dojo.addOnLoad(function() {
  dojo.connect(grid2, "onMouseOverRow", null, ShowItemFromGrid);
});


这篇关于onMouseOverRow事件无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆