分录字段设置焦点原创
金蝶云社区-张璋张
张璋张
3人赞赏了该文章 557次浏览 未经作者许可,禁止转载编辑于2023年05月11日 10:09:20

现在有个需求是A字段值更新,B字段要红框显示并切换焦点,写了一个方法修改字段外边框颜色和焦点

    private void changeColor(String entryKey,String field,String color,int rowIndex,Boolean judge){
        AbstractGrid grid = this.getView().getControl(entryKey);//获取分录表体
        ArrayList csList = new  ArrayList();
        CellStyle cs = new CellStyle();
        cs.setBackColor(color);//外边框颜色
        cs.setFieldKey(field);//列标识
        cs.setRow(rowIndex);//行索引
        csList.add(cs);
        grid.setCellStyle(csList);//设置单元格样式
         //设置焦点
        grid.focusCell(rowIndex,field);
    }


赞 3