jsTree插件:按钮在包含在每个项目中时无法工作
jsTree plugin : button can't work when it was included in each item
我用的是树视图插件,可以拖动。
我需要为每个项目添加按钮。
单击按钮后模态应该显示,但它不能工作 属性。
这是我的 link:
http://www.sldesign.url.tw/JsTree/index.html
好吧,我没有完全弄清楚根本原因,但作为解决方法,您可以做的是:
将点击处理程序附加到成员列表按钮:
$(function () {
// Init
$('#data').jstree({
'core': {
'multiple': false,
//"animation" : 0,
"check_callback": true,
//'force_text' : true,
'data': TestData
},
"plugins": ["contextmenu", "dnd", "state", "types", "wholerow"]
});
/*Attach Click function*/
setTimeout(() => {
$('.edit-member').each((index,el) => {
$(el).click(() => {
$('#exampleModal').show();
});
});
}, 1000);
/*Click function End*/
});
其次删除模态弹出代码上的"fade"
改变这个
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
至此
<div class="modal" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
我用的是树视图插件,可以拖动。 我需要为每个项目添加按钮。 单击按钮后模态应该显示,但它不能工作 属性。 这是我的 link: http://www.sldesign.url.tw/JsTree/index.html
好吧,我没有完全弄清楚根本原因,但作为解决方法,您可以做的是:
将点击处理程序附加到成员列表按钮:
$(function () {
// Init
$('#data').jstree({
'core': {
'multiple': false,
//"animation" : 0,
"check_callback": true,
//'force_text' : true,
'data': TestData
},
"plugins": ["contextmenu", "dnd", "state", "types", "wholerow"]
});
/*Attach Click function*/
setTimeout(() => {
$('.edit-member').each((index,el) => {
$(el).click(() => {
$('#exampleModal').show();
});
});
}, 1000);
/*Click function End*/
});
其次删除模态弹出代码上的"fade" 改变这个
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
至此
<div class="modal" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">