updating filter

This commit is contained in:
rlx 2011-06-01 15:03:22 +00:00
parent 46f40c0623
commit 7c23fb3741

View file

@ -249,6 +249,7 @@ Ox.Filter = function(options, self) {
function changeOperator(event, data) { function changeOperator(event, data) {
self.options.query.operator = data.selected[0].id; self.options.query.operator = data.selected[0].id;
that.$element.find('.OxGroupLabel').html(self.options.query.operator == '&' ? 'and' : 'or');
} }
function constructCondition(condition, pos) { function constructCondition(condition, pos) {
@ -345,24 +346,22 @@ Ox.Filter = function(options, self) {
return new Ox.FormElementGroup({ return new Ox.FormElementGroup({
elements: [ elements: [
new Ox.Label({ new Ox.Label({
title: self.options.operator == '&' ? 'and' : 'or', title: self.options.query.operator == '&' ? 'and' : 'or',
overlap: 'right', overlap: 'right',
width: 48 width: 48
}), }).addClass('OxGroupLabel'),
new Ox.FormElementGroup({ new Ox.FormElementGroup({
elements: [ elements: [
new Ox.Select({ new Ox.Select({
items: $.map(self.operators, function(operator) { items: $.map(self.operators, function(operator) {
Ox.print('!!!!', {
checked: operator.id != self.options.operator,
id: operator.id,
title: operator.title
});
return { return {
//checked: operator.id != self.options.operator, checked: operator.id != self.options.query.operator,
id: operator.id, id: operator.id,
title: operator.title // fixme: should be operator.title,
} // but is passed by reference to some select,
// which makes it an array
title: operator.title[0]
};
}), }),
width: 48 width: 48
}) })