Browse Source

BI-17050 multi_layer_single_tree

es6
windy 6 years ago
parent
commit
34f123a0b9
  1. 16
      demo/js/widget/tree/demo.multilayer_single_level_tree.js
  2. 7
      dist/base.js
  3. 12
      dist/bundle.js
  4. 16
      dist/demo.js
  5. 5
      dist/widget.js
  6. 7
      src/base/tree/customtree.js
  7. 5
      src/widget/multilayersingletree/multilayersingletree.leveltree.js

16
demo/js/widget/tree/demo.multilayer_single_level_tree.js

@ -7,23 +7,23 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
this.tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
items: BI.deepClone(Demo.CONSTANTS.TREE),
value: "第级文件1"
items: [],
value: "第级文件1"
});
return {
type: "bi.vtape",
items: [{
el: tree
el: this.tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
BI.Msg.alert("", JSON.stringify(self.tree.getValue()));
}
},
height: 25
@ -33,7 +33,7 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
self.tree.setValue(["第二级文件1"]);
}
},
height: 25
@ -41,6 +41,10 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
width: 500,
hgap: 300
};
},
mounted: function () {
this.tree.populate(BI.deepClone(Demo.CONSTANTS.TREE));
}
});

7
dist/base.js vendored

@ -34238,12 +34238,13 @@ BI.CustomTree = BI.inherit(BI.Widget, {
if (BI.isNotEmptyArray(node.children) || node.isParent === true) {
var item = BI.extend({
type: "bi.expander",
el: {},
el: {
value: node.value
},
popup: {type: "bi.custom_tree"}
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId,
value: node.value
pId: node.pId
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {

12
dist/bundle.js vendored

@ -69724,12 +69724,13 @@ BI.CustomTree = BI.inherit(BI.Widget, {
if (BI.isNotEmptyArray(node.children) || node.isParent === true) {
var item = BI.extend({
type: "bi.expander",
el: {},
el: {
value: node.value
},
popup: {type: "bi.custom_tree"}
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId,
value: node.value
pId: node.pId
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {
@ -97156,7 +97157,10 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
},
getValue: function () {
return BI.uniq(this.tree.getValue());
return BI.filter(BI.uniq(this.tree.getValue()), function (idx, value) {
return BI.isNotNull(value);
});
},
getAllLeaves: function () {

16
dist/demo.js vendored

@ -14231,23 +14231,23 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
this.tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
items: BI.deepClone(Demo.CONSTANTS.TREE),
value: "第级文件1"
items: [],
value: "第级文件1"
});
return {
type: "bi.vtape",
items: [{
el: tree
el: this.tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
BI.Msg.alert("", JSON.stringify(self.tree.getValue()));
}
},
height: 25
@ -14257,7 +14257,7 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
self.tree.setValue(["第二级文件1"]);
}
},
height: 25
@ -14265,6 +14265,10 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
width: 500,
hgap: 300
};
},
mounted: function () {
this.tree.populate(BI.deepClone(Demo.CONSTANTS.TREE));
}
});

5
dist/widget.js vendored

@ -10485,7 +10485,10 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
},
getValue: function () {
return BI.uniq(this.tree.getValue());
return BI.filter(BI.uniq(this.tree.getValue()), function (idx, value) {
return BI.isNotNull(value);
});
},
getAllLeaves: function () {

7
src/base/tree/customtree.js

@ -44,12 +44,13 @@ BI.CustomTree = BI.inherit(BI.Widget, {
if (BI.isNotEmptyArray(node.children) || node.isParent === true) {
var item = BI.extend({
type: "bi.expander",
el: {},
el: {
value: node.value
},
popup: {type: "bi.custom_tree"}
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId,
value: node.value
pId: node.pId
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {

5
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -112,7 +112,10 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
},
getValue: function () {
return BI.uniq(this.tree.getValue());
return BI.filter(BI.uniq(this.tree.getValue()), function (idx, value) {
return BI.isNotNull(value);
});
},
getAllLeaves: function () {

Loading…
Cancel
Save