diff options
author | Igor Sfiligoi <isfiligoi@ucsd.edu> | 2009-06-25 19:43:14 +0000 |
---|---|---|
committer | Igor Sfiligoi <isfiligoi@ucsd.edu> | 2009-06-25 19:43:14 +0000 |
commit | a94a1a41885d29db544690636baf0211665dd182 (patch) | |
tree | e4264cb09d84d2483c78da954f8749ae4d391666 /src | |
parent | 72ebdee12f31465ab275b72a405885f97702c857 (diff) |
Display RRDcbs in multiple columns, if needed
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/rrdFlotMatrix.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/rrdFlotMatrix.js b/src/lib/rrdFlotMatrix.js index aa057bd..4b0dfa9 100644 --- a/src/lib/rrdFlotMatrix.js +++ b/src/lib/rrdFlotMatrix.js @@ -210,9 +210,18 @@ rrdFlotMatrix.prototype.populateRRDcb = function() { // First clean up anything in the element
while (form_el.lastChild!=null) form_el.removeChild(form_el.lastChild);
+ var table_el=document.createElement("Table");
+ var row_el=table_el.insertRow(-1);
+ row_el.vAlign="top";
+ var cell_el=null; // will define later
+
// now populate with RRD info
var nrRRDs=this.rrd_files.length;
for (var i=0; i<nrRRDs; i++) {
+ if ((i%15)==0) { // one column every 15 elements
+ cell_el=row_el.insertCell(-1);
+ }
+
var rrd_el=this.rrd_files[i];
var rrd_file=rrd_el[1];
var name=rrd_el[0];
@@ -238,10 +247,11 @@ rrdFlotMatrix.prototype.populateRRDcb = function() { cb_el.name = "rrd";
cb_el.value = i;
cb_el.checked = cb_el.defaultChecked = checked;
- form_el.appendChild(cb_el);
- form_el.appendChild(document.createTextNode(title));
- form_el.appendChild(document.createElement('br'));
+ cell_el.appendChild(cb_el);
+ cell_el.appendChild(document.createTextNode(title));
+ cell_el.appendChild(document.createElement('br'));
}
+ form_el.appendChild(table_el);
};
// ======================================
|