EAS列表数据定位

// 定位代码
protected void supply_dataChanged(DataChangeEvent e) {
		String sel = e.getNewValue().toString();   
		int col = 0;
		Object obj = null;
		String number = null;
		try {
			int endIndex = KDTableUtil.getLastVisibleRowIndex(this.tblMain);
                        int beginIndex = KDTableUtil.getFirstVisibleRowIndex(this.tblMain);
			// 获取number
			for(int i = beginIndex ; i < endIndex; i++){
				obj = tblMain.getCell(i,"number").getValue();
				if(obj == null){
					obj= "";
				}
				number = obj.toString();
	        	if(sel.equals(number)){
	        		col = i;
	        		break;
	        	}
			}
			// list定位
			this.tblMain.getSelectManager().select(3,1);
			this.tblMain.getLayoutManager().scrollColToShow(col);
			setTheFirstFillData(true);    
			tblMain.repaint(); 
		} catch (Exception e1) {	
			e1.printStackTrace();
		}
		
	}

posted @ 2022-07-14 17:35  明明很有才  阅读(51)  评论(0)    收藏  举报