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;
}
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM