javascript - 选择选项列表在组部分中不可点击(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',
};
预期结果:单击展开选择,我可以选择一些选项。实际结果:单击没有任何反应。
解决方案
推荐阅读
- c++ - 查找并绘制从形状中心到最近边缘的线
- javascript - 当使用 node.js 的集合中存在值时,Firebase 返回 false 值
- python - 如何为 10 个特征添加填充特征值?
- css - 纯 CSS 无限滚动在移动设备上不起作用
- spring - 如何在 spring-data-jpa-solr 中使字段不可搜索
- vue.js - 如何获得“manifest.json”的正确图标路径?
- soap - 访问被拒绝用户是匿名的-spring boot ws基本身份验证
- django - 如何在基于函数的视图中引发 @permission_required 装饰器的错误
- javascript - 将 json 对象数组解析为特定格式
- python - UnicodeEncodeError:“ascii”编解码器无法在位置 34 编码字符 u'\u05a0':序数不在范围内(128)