eas之得到当前选中的行id

其实有个快捷键:ctrl+shift+C 就可以直接拿到了....


public String[] getSelected(){
checkSelected;
//SelectManager是kdtable中行管理类
ArrayList bolcks=tblMain.getSelectManager().getBlocks();
ArrayList idList=new ArrayList();
Iterator iterator=block.iterator();
while(iterator.hasNext()){
KDTSelectBlock block=(KDTSelectBlock)iterator.next();
int top=block.getTop();
int bottom=block.getBottom();
for(int rowIndex=top;rowIndex<=bottom;rowIndex++){
ICell cell=tbMain.getRow(rowIndex).getCell(getKeyFieldName());//获取指定分录的单元格的对象
if(idList.contains(cell.getValue())){
idList.add(cell.getValue());
}
}
}
String[] listId=null;
if(idList!=null && idList.size()>0){
Iterator iterator=idList.iterator();
listId=new String[idList.Size()];
int index=0;
while(iterator.hasNext()){
listId[index]=(String)iterator.next();
index++;
}
return listId;
}
}

posted @ 2019-06-26 08:12  一条有梦想的海洋咸鱼  阅读(1246)  评论(0编辑  收藏  举报