added property dependend info rendering

This commit is contained in:
Steffen Vogel 2010-11-08 00:26:05 +01:00
parent 232e59a08e
commit 788684b3f3
2 changed files with 16 additions and 3 deletions

View file

@ -74,6 +74,19 @@ Entity.prototype.getDOM = function() {
for (var property in this) {
if (this.hasOwnProperty(property) && property != 'data' && property != 'children') {
switch(property) {
case 'color':
var value = '<span style="background-color: ' + this[property] + '">' + this[property] + '</span>';
break;
case 'active':
var value = (this[property]) ? 'yes' : 'no';
break;
default:
var value = this[property];
}
data.append($('<tr>')
.append($('<td>')
.addClass('key')
@ -81,7 +94,7 @@ Entity.prototype.getDOM = function() {
)
.append($('<td>')
.addClass('value')
.text(this[property])
.append(value)
)
);
}

View file

@ -367,7 +367,7 @@ vz.entities.loadData = function() {
if (entity.active && entity.type != 'group') { // TODO add group data aggregation
vz.load('data', entity.uuid,
{
from: Math.floor(vz.options.plot.xaxis.min),
from: Math.floor(vz.options.plot.xaxis.min), // TODO fetch enough data to fill the holes on the beginning and the end of the plot
to: Math.ceil(vz.options.plot.xaxis.max),
tuples: vz.options.tuples
},
@ -431,7 +431,7 @@ vz.load = function(context, identifier, data, success) {
data: data,
error: function(xhr) {
json = JSON.parse(xhr.responseText);
vz.wui.dialogs.error(xhr.statusText, json.exception.message, xhr.status); // TODO error vs. exception
vz.wui.dialogs.error(xhr.statusText, json.exception.message, xhr.status); // TODO throw exception?
}
});
};