- // JavaScript source code
- var table = Forguncy.Page.getListView("表格1");
- var rowCount = table.getRowCount();
- var initialData = new Array();
- for (var i = 0; i < rowCount; i++)
- {
- initialData.push({
- id: parseInt(table.getText(i, 0)),
- pid: parseInt(table.getText(i, 2))
- });
- }
- var children = new Array();
- var getChildren = function(id)
- {
- for(var i = 0; i < initialData.length; i++)
- {
- var currentID = initialData[i].id;
- var currentPID = initialData[i].pid;
- if (currentPID == parseInt(id))
- {
- children.push(currentID);
- getChildren(currentID);
- }
- }
- }
- var index = table.getSelectedRowIndex();
- var id = table.getText(index, 0);
- getChildren(id);
- var cp = Forguncy.Page.getCell("childrenPanel");
- cp.setValue(children.toString());
复制代码
|