ExtJs4.0中怎么获取到grid的单元格
展开全部
在grid中添加监听函数,监听单元格点击cellclick,使用如下代码即可实现。
1
2
3
4
5
6
7
8
9
10
11
//EXT GridPanel获取某一单元格的值
listeners:{
'cellclick':function(grid, rowIndex, columnIndex, e){
editCell_row = rowIndex;
editCell_col = columnIndex;
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);
alert(record+fieldName+data);
}
}
1
2
3
4
5
6
7
8
9
10
11
//EXT GridPanel获取某一单元格的值
listeners:{
'cellclick':function(grid, rowIndex, columnIndex, e){
editCell_row = rowIndex;
editCell_col = columnIndex;
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);
alert(record+fieldName+data);
}
}
展开全部
//EXT GridPanel获取某一单元格的值
listeners:{
'cellclick':function(grid, rowIndex, columnIndex, e){
editCell_row = rowIndex;
editCell_col = columnIndex;
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);
alert(record+fieldName+data);<img id="selectsearch-icon" src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/iknow/qb/select-search.png" alt="搜索">
}
}
listeners:{
'cellclick':function(grid, rowIndex, columnIndex, e){
editCell_row = rowIndex;
editCell_col = columnIndex;
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);
alert(record+fieldName+data);<img id="selectsearch-icon" src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/iknow/qb/select-search.png" alt="搜索">
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询