Charts: Fix group matching

This commit is contained in:
Aysam Guerler
2014-06-15 10:01:11 -04:00
parent 4262fdc784
commit da9eda287a
3 changed files with 10 additions and 8 deletions
File diff suppressed because one or more lines are too long
@@ -99,7 +99,7 @@ var View = Backbone.View.extend(
// delete all
delAll: function() {
this.$tbody.html('');
this.$tbody.empty();
this.row_count = 0;
this._refresh();
},
@@ -180,6 +180,11 @@ return Backbone.View.extend(
// update selection list
select.update(columns);
// set initial value
if (is_unique && this.chart.groups.first()) {
this.group.set(id, this.chart.groups.first().get(id));
}
// update current value
if (!select.exists(this.group.get(id))) {
// get first value
@@ -192,14 +197,11 @@ return Backbone.View.extend(
this.group.set(id, first);
}
// set initial value
if (is_unique && this.chart.groups.first()) {
select.value(this.chart.groups.first().get(id));
} else {
select.value(this.group.get(id));
}
// set group value
select.value(this.group.get(id));
// link group with select field
this.group.off('change:' + id);
this.group.on('change:' + id, function(){
select.value(self.group.get(id));
});