|
- var r = justep.Request.sendBizRequest(null, null, "ksqlSelectTestAction", actionParam);
- var table = justep.Request.getData(r.responseXML);
- var columnIDs = justep.XML.getNodeText(table, "//userdata[@name='relation-alias']").split(",");
- var grid = justep.xbl("gridTest").grid;
-
- for (var i = 0; i < columnIDs.length; i++) {
- if (i < grid.getColumnCount()) {
- grid.columnIds[i] = columnIDs[i];
- grid.setColumnLabel(i, columnIDs[i]);
- // 恢复隐藏列
- grid.setColumnHidden(i, false);
- } else {
- // 添加新列
- grid.insertColumn(i, columnIDs[i], "ro", "100");
- grid.columnIds[i] = columnIDs[i];
- }
- }
- // 隐藏多余列
- for (var i = columnIDs.length; i < grid.getColumnCount(); i++) {
- grid.setColumnHidden(i, true);
- }
- // 初始化列
- grid.initField();
- var dataTest = justep.xbl("dataTest");
- dataTest.loadXML(table);
复制代码 |
|