首页 > 解决方案 > 选择选项列表在组部分中不可点击(vis.js 时间表库)

问题描述

尝试将选择选项列表插入每个组单元格。它显示为一个选择元素,但它不像通常的选择那样通过单击来展开。它不会对点击做出反应。

var options   = {
            groupOrder: function (a, b) {
                return a.value - b.value;
            },

            groupTemplate: function(group) {
                var container = document.createElement('div');
                var select    = document.createElement('select');

                groups.forEach(function (i) {
                    var option       = document.createElement('option');
                    option.innerHTML = i.content + ' ';
                    container.insertAdjacentElement('afterBegin',select);
                    select.insertAdjacentElement('afterBegin',option);
                });

                return container;
            },
            orientation: 'both',
            editable: {
                add: true,         // add new items by double tapping
                updateTime: true,  // drag items horizontally
                updateGroup: true, // drag items from one group to another
                remove: true,       // delete an item by tapping the delete button top right
                overrideItems: true  // allow these options to override item.editable
            },
            groupEditable: true,

            start: '2019-02-01',
            end: '2019-03-01',
        };

预期结果:单击展开选择,我可以选择一些选项。实际结果:单击没有任何反应。

标签: javascriptvis.jsvis.js-timeline

解决方案


推荐阅读