guy 7 years ago
parent
commit
270567593a
  1. 36
      bi/widget.js
  2. 36
      dist/bundle.js
  3. 10
      dist/bundle.min.js
  4. 36
      dist/widget.js
  5. 10
      src/widget/multitree/multi.tree.combo.js
  6. 26
      src/widget/multitree/trigger/searcher.multi.tree.js

36
bi/widget.js

@ -12586,7 +12586,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? {1: 1} : {}
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
@ -12642,6 +12642,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}
});
});
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
@ -12670,11 +12671,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: this.getSearcher().hasChecked() ? {1: 1} : {}
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(val);
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
});
@ -12694,7 +12696,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
if (isSearching()) {
self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}else{
} else {
if (isPopupView()) {
self.trigger.stopEditing();
self.storeValue = {value: self.combo.getValue()};
@ -13105,11 +13107,29 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
setState: function (ob) {
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
ob.value || (ob.value = {});
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
var text = "";
BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
});
this.editor.setState(text);
}
function getChildrenNode(ob) {
var text = "";
var index = 0, size = BI.size(ob);
BI.each(ob, function (name, children) {
index++;
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
});
return text;
}
},

36
dist/bundle.js vendored

@ -87632,7 +87632,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? {1: 1} : {}
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
@ -87688,6 +87688,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}
});
});
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
@ -87716,11 +87717,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: this.getSearcher().hasChecked() ? {1: 1} : {}
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(val);
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
});
@ -87740,7 +87742,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
if (isSearching()) {
self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}else{
} else {
if (isPopupView()) {
self.trigger.stopEditing();
self.storeValue = {value: self.combo.getValue()};
@ -88151,11 +88153,29 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
setState: function (ob) {
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
ob.value || (ob.value = {});
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
var text = "";
BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
});
this.editor.setState(text);
}
function getChildrenNode(ob) {
var text = "";
var index = 0, size = BI.size(ob);
BI.each(ob, function (name, children) {
index++;
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
});
return text;
}
},

10
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

36
dist/widget.js vendored

@ -12586,7 +12586,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? {1: 1} : {}
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
@ -12642,6 +12642,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}
});
});
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
@ -12670,11 +12671,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: this.getSearcher().hasChecked() ? {1: 1} : {}
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(val);
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
});
@ -12694,7 +12696,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
if (isSearching()) {
self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}else{
} else {
if (isPopupView()) {
self.trigger.stopEditing();
self.storeValue = {value: self.combo.getValue()};
@ -13105,11 +13107,29 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
setState: function (ob) {
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
ob.value || (ob.value = {});
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
var text = "";
BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
});
this.editor.setState(text);
}
function getChildrenNode(ob) {
var text = "";
var index = 0, size = BI.size(ob);
BI.each(ob, function (name, children) {
index++;
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
});
return text;
}
},

10
src/widget/multitree/multi.tree.combo.js

@ -80,7 +80,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? {1: 1} : {}
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
@ -136,6 +136,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}
});
});
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
@ -164,11 +165,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: this.getSearcher().hasChecked() ? {1: 1} : {}
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(val);
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
});
@ -188,7 +190,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
if (isSearching()) {
self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}else{
} else {
if (isPopupView()) {
self.trigger.stopEditing();
self.storeValue = {value: self.combo.getValue()};

26
src/widget/multitree/trigger/searcher.multi.tree.js

@ -102,11 +102,29 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
setState: function (ob) {
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
ob.value || (ob.value = {});
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
var text = "";
BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
});
this.editor.setState(text);
}
function getChildrenNode(ob) {
var text = "";
var index = 0, size = BI.size(ob);
BI.each(ob, function (name, children) {
index++;
var childNodes = getChildrenNode(children);
text += name + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
});
return text;
}
},

Loading…
Cancel
Save