Flask接口签名sign原理与实例代码浅析
449
2023-03-21
BootStrap TreeView使用实例详解
本文实例为大家分享了BootStrap TreeView使用代码,供大家参考,具体内容如下
$(function () {
function getTree() {
/jJUPYloWXj/ Some logic to retrieve, or generate tree structure
var data = [{
text: "p1",
nodes: [{ text: "p1-1", id: '00001', nodeId: '00001' }, { text: "p1-2", id: '00002' }, { text: "p1-3", id: '00003' }, { text: "p1-4", id: '00004', nodes: [{ text: 'p1-1-1', id: '00005'}]}]
}]
return data;
}
var obj = {};
obj.text = "123";
$('#tree').treeview({
data: getTree(), // data is not optional
levels: 5,
multiSelect: true
});
$("#btn").click(function (e) {
var arr = $('#tree').treeview('getSelected');
alert(JSON.stringify(arr));
for (var key in arr) {
alert(arr[key].id);
}
})
})
弹窗口+树形菜单的具体代码
data-target="#myModal">
开始演示模态框
aria-labelledby="myModalLabel" aria-hidden="true">
data-dismiss="modal" aria-hidden="true">
×
模态框(Modal)标题
data-dismiss="modal">关闭
jJUPYloWXj
提交更改
$(function () {
function getTree() {
// Some logic to retrieve, or generate tree structure
var data = [{
text: "p1",
nodes: [{ text: "p1-1", id: '00001', nodeId: '00001' }, { text: "p1-2", id: '00002' }, { text: "p1-3", id: '00003' }, { text: "p1-4", id: '00004', nodes: [{ text: 'p1-1-1', id: '00005'}]}]
}]
return data;
}
var obj = {};
obj.text = "123";
$('#tree').treeview({
data: getTree(), // data is not optional
levels: 5,
multiSelect: true
});
$("#btn").click(function (e) {
var arr = $('#tree').treeview('getSelected');
for (var key in arr) {
c.innerHTML = c.innerHTML + "," + arr[key].id;
}
})
})
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~