eas之利用KDTableHelper批量填充数据
// 下述代码将创建一个KDTable,并指定列名、表头单元格的显示值、和表体数据
KDTable table = new KDTable();
String [] columnKeys = new String[]{"a","b","c","d"};
String [] head = new String[]{"a1","b1","c1","d1"};
String [][] body = new String[][] {{"a11","b11","c11","d11"},{"a22", "b22", "c22", "d22"}};
KDTableHelper.initTable(table, columnKeys, head, body);
// 下述代码先创建一个Collection数组,再将Collection数组填充到table中
int length = 5;
List [] ls = new ArrayList[length];
for (int j = 0; j < length; j++){
List l = new ArrayList();
for (int i = 0; i < 20; i++)
{
l.add("cell " + i);
}
ls[j] = l;
}
KDTableHelper.addRows(table, ls);
。。。
承接钉钉定制;网站服务定制;
联系qq:1655119603