|
|
@ -28,12 +28,7 @@ Demo.Func = BI.inherit(BI.Widget, { |
|
|
|
hgap: 30 |
|
|
|
hgap: 30 |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: BI.deepClone(TREEITEMS), |
|
|
|
items: BI.deepClone(TREEITEMS) |
|
|
|
expander: { |
|
|
|
|
|
|
|
el: {}, |
|
|
|
|
|
|
|
popup: {type: "bi.custom_tree"}, |
|
|
|
|
|
|
|
trigger: "hover" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
return this.tree; |
|
|
|
return this.tree; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -63,57 +58,58 @@ Demo.Func = BI.inherit(BI.Widget, { |
|
|
|
}]); |
|
|
|
}]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (op.node.id == 1) { |
|
|
|
if (op.node.id == 1) { |
|
|
|
callback([{ |
|
|
|
callback([ |
|
|
|
id: 11, |
|
|
|
{ |
|
|
|
pId: 1, |
|
|
|
id: 11, |
|
|
|
type: "bi.plus_group_node", |
|
|
|
pId: 1, |
|
|
|
text: "test11", |
|
|
|
type: "bi.plus_group_node", |
|
|
|
value: 11, |
|
|
|
text: "test11", |
|
|
|
height: 25, |
|
|
|
value: 11, |
|
|
|
isParent: true |
|
|
|
height: 25, |
|
|
|
}, { |
|
|
|
isParent: true |
|
|
|
id: 12, |
|
|
|
}, |
|
|
|
pId: 1, |
|
|
|
{ |
|
|
|
type: "bi.single_select_item", |
|
|
|
id: 12, |
|
|
|
text: "test12", |
|
|
|
pId: 1, |
|
|
|
value: 12, |
|
|
|
type: "bi.single_select_item", |
|
|
|
height: 35 |
|
|
|
text: "test12", |
|
|
|
}, { |
|
|
|
value: 12, |
|
|
|
id: 13, |
|
|
|
height: 35 |
|
|
|
pId: 1, |
|
|
|
}, |
|
|
|
type: "bi.single_select_item", |
|
|
|
{ |
|
|
|
text: "test13", |
|
|
|
id: 13, |
|
|
|
value: 13, |
|
|
|
pId: 1, |
|
|
|
height: 35 |
|
|
|
type: "bi.single_select_item", |
|
|
|
}, { |
|
|
|
text: "test13", |
|
|
|
id: 14, |
|
|
|
value: 13, |
|
|
|
pId: 1, |
|
|
|
height: 35 |
|
|
|
type: "bi.single_select_item", |
|
|
|
}, |
|
|
|
text: "test14", |
|
|
|
{ |
|
|
|
value: 14, |
|
|
|
id: 14, |
|
|
|
height: 35 |
|
|
|
pId: 1, |
|
|
|
}, { |
|
|
|
type: "bi.single_select_item", |
|
|
|
id: 15, |
|
|
|
text: "test14", |
|
|
|
pId: 1, |
|
|
|
value: 14, |
|
|
|
type: "bi.single_select_item", |
|
|
|
height: 35 |
|
|
|
text: "test15", |
|
|
|
}, |
|
|
|
value: 15, |
|
|
|
{ |
|
|
|
height: 35 |
|
|
|
id: 15, |
|
|
|
}, { |
|
|
|
pId: 1, |
|
|
|
id: 16, |
|
|
|
type: "bi.single_select_item", |
|
|
|
pId: 1, |
|
|
|
text: "test15", |
|
|
|
type: "bi.single_select_item", |
|
|
|
value: 15, |
|
|
|
text: "test16", |
|
|
|
height: 35 |
|
|
|
value: 16, |
|
|
|
}, |
|
|
|
height: 35 |
|
|
|
{ |
|
|
|
}, { |
|
|
|
id: 16, |
|
|
|
id: 17,
|
|
|
|
pId: 1, |
|
|
|
pId: 1,
|
|
|
|
type: "bi.single_select_item", |
|
|
|
type: "bi.single_select_item",
|
|
|
|
text: "test16", |
|
|
|
text: "test17",
|
|
|
|
value: 16, |
|
|
|
value: 17,
|
|
|
|
height: 35 |
|
|
|
height: 35 |
|
|
|
}, |
|
|
|
}]); |
|
|
|
{id: 17, pId: 1, type: "bi.single_select_item", text: "test17", value: 17, height: 35} |
|
|
|
|
|
|
|
]); |
|
|
|
} else if (op.node.id == 2) { |
|
|
|
} else if (op.node.id == 2) { |
|
|
|
callback([{ |
|
|
|
callback([{ |
|
|
|
id: 21, |
|
|
|
id: 21, |
|
|
@ -122,7 +118,8 @@ Demo.Func = BI.inherit(BI.Widget, { |
|
|
|
text: "test21", |
|
|
|
text: "test21", |
|
|
|
value: 21, |
|
|
|
value: 21, |
|
|
|
height: 35 |
|
|
|
height: 35 |
|
|
|
}, { |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
id: 22, |
|
|
|
id: 22, |
|
|
|
pId: 2, |
|
|
|
pId: 2, |
|
|
|
type: "bi.single_select_item", |
|
|
|
type: "bi.single_select_item", |
|
|
@ -154,12 +151,6 @@ Demo.Func = BI.inherit(BI.Widget, { |
|
|
|
vgap: 0 |
|
|
|
vgap: 0 |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
expander: { |
|
|
|
|
|
|
|
el: {}, |
|
|
|
|
|
|
|
popup: {type: "bi.custom_tree"}, |
|
|
|
|
|
|
|
trigger: "click", |
|
|
|
|
|
|
|
direction: "bottom" |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return this.asyncTree; |
|
|
|
return this.asyncTree; |
|
|
@ -177,68 +168,75 @@ Demo.Func = BI.inherit(BI.Widget, { |
|
|
|
row: 0, |
|
|
|
row: 0, |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.vtape", |
|
|
|
type: "bi.vtape", |
|
|
|
items: [{ |
|
|
|
items: [ |
|
|
|
el: this._createDefaultTree() |
|
|
|
{ |
|
|
|
}, { |
|
|
|
el: this._createDefaultTree() |
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.center", |
|
|
|
|
|
|
|
hgap: 10, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getValue", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.tree.getValue())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getNodeByValue(第一级目录1)", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", "节点名称为: " + self.tree.getNodeByValue("第一级目录1").getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
height: 30 |
|
|
|
{ |
|
|
|
}] |
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.center", |
|
|
|
|
|
|
|
hgap: 10, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getValue", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.tree.getValue())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getNodeByValue(第一级目录1)", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", "节点名称为: " + self.tree.getNodeByValue("第一级目录1").getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
height: 30 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
column: 1, |
|
|
|
column: 1, |
|
|
|
row: 0, |
|
|
|
row: 0, |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.vtape", |
|
|
|
type: "bi.vtape", |
|
|
|
items: [{ |
|
|
|
items: [ |
|
|
|
type: "bi.label", |
|
|
|
{ |
|
|
|
text: "异步加载数据", |
|
|
|
type: "bi.label", |
|
|
|
height: 30 |
|
|
|
text: "异步加载数据", |
|
|
|
}, { |
|
|
|
height: 30 |
|
|
|
el: this._createAsyncTree() |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.center", |
|
|
|
|
|
|
|
hgap: 10, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getValue", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.asyncTree.getValue())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getNodeById(11)", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", "节点名称为: " + (self.asyncTree.getNodeById(11) && self.asyncTree.getNodeById(11).getText())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
height: 30 |
|
|
|
{ |
|
|
|
}] |
|
|
|
el: this._createAsyncTree() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.center", |
|
|
|
|
|
|
|
hgap: 10, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getValue", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.asyncTree.getValue())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: "bi.text_button", |
|
|
|
|
|
|
|
cls: "mvc-button layout-bg2", |
|
|
|
|
|
|
|
text: "getNodeById(11)", |
|
|
|
|
|
|
|
height: 30, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
BI.Msg.alert("", "节点名称为: " + (self.asyncTree.getNodeById(11) && self.asyncTree.getNodeById(11).getText())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
height: 30 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|