[jsTree plugin:当按钮包含在每个项目中时,按钮将不起作用

问题描述 投票:0回答:1

我使用可以拖动的树形视图插件。我需要为每个项目添加按钮。单击按钮后应显示模态,但该属性不能正常工作。这是我的链接:http://www.sldesign.url.tw/JsTree/index.html

javascript jstree
1个回答
0
投票

嗯,我并没有完全找到根本原因,但是作为一种解决方法,您可以::>

将点击处理程序附加到成员列表按钮:

 $(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*/
            });

接着删除模式弹出式代码上的“淡入淡出”更改此

<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">
© www.soinside.com 2019 - 2024. All rights reserved.