grid.on('keydown', function(e) {
var grid = Ext.getCmp('projectCaseListId');
var k = e.getKey();
var view = grid.getView();
if(grid.getSelectionModel().getCount()>=1){//checkselect时不响应该事件
view.removeRowClass(lastrownum1,'x-grid3-row-selected1');
return ;
}
if(k==38){ //up
if(lastrownum1==0)//在最上面一行时位置保持不动
{
view.focusRow(0);
lastrownum1=0;
}else{
view.removeRowClass(lastrownum1,'x-grid3-row-selected1');//移除上一次的高亮显示样式
lastrownum1=lastrownum1-1;
view.focusRow(lastrownum1);
view.addRowClass(lastrownum1,'x-grid3-row-selected1');//添加目标行的高亮样式
}
}
if(k==40){//down
if(lastrownum1==(grid.getStore().getCount()-1))
{
lastrownum1=grid.getStore().getCount()-1;
view.focusRow(lastrownum1);
}else{
view.removeRowClass(lastrownum1,'x-grid3-row-selected1');
lastrownum1=lastrownum1+1;
view.focusRow(lastrownum1);
view.addRowClass(lastrownum1,'x-grid3-row-selected1');
}
}
}
x-grid3-row-selected1 //jsp中新加的select样式,select样式去掉check部分即可