diff options
author | xzilla | 2007-09-04 15:25:18 +0000 |
---|---|---|
committer | xzilla | 2007-09-04 15:25:18 +0000 |
commit | 1aeed05fa7cf099fc952aa012526eea1963e1988 (patch) | |
tree | 03897d19d6c9e38f48c8d25d23331ba216aa170e | |
parent | 93a3e0bd71664ad4bcd6513be29751886419009c (diff) |
auto expand a node in the tree (browser) if there's no other node. patch from Tomasz Pala
-rw-r--r-- | CREDITS | 2 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | xloadtree/xloadtree2.js | 8 |
3 files changed, 10 insertions, 1 deletions
@@ -61,6 +61,8 @@ Contributors - Eric Kinolik - John Jawed - JGuillaume 'ioguix' De Rorthais +- Karl O. Pinc +- Tomasz Pala Third Party Libraries @@ -12,6 +12,7 @@ Features * Pagination selection available for reports * You can configure reports db, schema and table names * Add support for creating a table using an exsting one (ioguix) +* Auto-expand a node in the tree browser if there are no other nodes (Tomasz Pala) Bugs * Fix inability to assign a field type/domain of a different schema diff --git a/xloadtree/xloadtree2.js b/xloadtree/xloadtree2.js index 87dbc6d1..b36eed7e 100644 --- a/xloadtree/xloadtree2.js +++ b/xloadtree/xloadtree2.js @@ -405,13 +405,19 @@ WebFXLoadTree.documentLoaded = function (jsNode) { var count = 0;
var cs = root.childNodes;
var l = cs.length;
+ var newNode;
for (var i = 0; i < l; i++) {
if (cs[i].tagName == "tree") {
- jsNode.add(WebFXLoadTree.createItemFromElement(cs[i]));
+ newNode=WebFXLoadTree.createItemFromElement(cs[i]);
+ jsNode.add(newNode);
count++;
}
}
+ if (count == 1 && newNode.childNodes.length) {
+ var parent=jsNode.parentNode;
+ newNode.setExpanded(true);
+ }
// if no children we got an error
if (count == 0) {
jsNode.errorText = webFXTreeConfig.errorLoadingText + " " + jsNode.src + " (???)";
|