如何取到 Ext grid 的行号?
j2eebs
2008-08-06
请问单击一行时或者 onmouseup 时如何取到当前行的行号?谢谢 ~
|
|
wqrpcuser
2008-08-06
我在给grid注册了一个监听器:
grid.addListener("cellclick", cellclick);
然后在定义这个方法:
function cellclick(grid, rowIndex, columnIndex, e){
var record = grid.getStore().getAt(rowIndex); //Get the Record
var fieldName = grid.getColumnModel().getDataIndex(columnIndex); //Get field name
if (fieldName == 'name') {
var data = record.get(fieldName);
Ext.MessageBox.alert("show", "你选中了一个人的名称,他的名称是" + data);
};
}
这个事件的api是这样:
cellclick : ( Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e )
|
|
kimmking
2008-08-06
Ext 2.0 API:
[code="java"]
rowclick : ( Grid this, Number rowIndex, Ext.EventObject e )
Fires when a row is clicked
Fires when a row is clicked
Listeners will be called with the following arguments:
this : Grid
rowIndex : Number
e : Ext.EventObject
[/code]
rowclick的第二个参数
|
相关讨论
相关资源推荐
- hibernate中session 与JDBC中 connection分析
- org.hibernate.HibernateException: Unable to make JDBC Connection
- Spring 项目启动测试的时候错误:Unable to acquire JDBC Connection
- org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
- Java中jdbc、hibernate、mybatis浅析
- Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection
- 关于org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution错误
- org.hibernate.TransactionException: unable to commit against JDBC connection
- Unable to open JDBC Connection for DDL execution
- 搭建hibernate环境 使用JDBC连接数据库