|
|
|
@ -16,6 +16,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
|
item.setNotSelectedValue(v); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
@ -31,6 +32,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (BI.isFunction(item.setEnabledValue)) { |
|
|
|
|
item.setEnabledValue(v); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
@ -46,6 +48,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
|
item.setValue(v); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
@ -61,12 +64,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
|
v = BI.concat(v, item.getNotSelectedValue()); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (item.isEnabled() && item.isSelected && !item.isSelected()) { |
|
|
|
|
v.push(item.getValue()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return v; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -75,12 +80,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
|
v = BI.concat(v, item.getValue()); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
|
|
v.push(item.getValue()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return v; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -89,12 +96,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
|
btns = btns.concat(item.getSelectedButtons()); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (item.isSelected && item.isSelected()) { |
|
|
|
|
btns.push(item); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return btns; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -103,12 +112,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
|
btns = btns.concat(item.getNotSelectedButtons()); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (item.isSelected && !item.isSelected()) { |
|
|
|
|
btns.push(item); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return btns; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -118,12 +129,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
|
leaves = leaves.concat(item.getAllLeaves()); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (item.isEnabled()) { |
|
|
|
|
leaves.push(item); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return leaves; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -133,9 +146,11 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
var vs = item.getValue(); |
|
|
|
|
if (item.isEnabled() && (vs === value || BI.contains(vs, value))) { |
|
|
|
|
index = i; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return index; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -145,14 +160,17 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
if (item.isEnabled()) { |
|
|
|
|
if (item.attr("id") === id) { |
|
|
|
|
node = item; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} else if (BI.isFunction(item.getNodeById)) { |
|
|
|
|
if (node = item.getNodeById(id)) { |
|
|
|
|
node = item.getNodeById(id); |
|
|
|
|
if (node) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return node; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -161,15 +179,18 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
|
|
|
|
|
BI.any(this.buttons, function (i, item) { |
|
|
|
|
if (item.isEnabled()) { |
|
|
|
|
if (BI.isFunction(item.getNodeByValue)) { |
|
|
|
|
if (node = item.getNodeByValue(value)) { |
|
|
|
|
node = item.getNodeByValue(value); |
|
|
|
|
if (node) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} else if (item.attr("value") === value) { |
|
|
|
|
node = item; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return node; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|