代码生成可编辑的时间轴。但我想移动主要组以及嵌套组。我找不到任何解决方案,但尝试了很多。
有没有想过如何将嵌套组SomeSort1组“Formula E”移动到“MotoGP”组?
var groups = new vis.DataSet([
{"content": "Formula E", nestedGroups: ["SomeSort1"]},
{"content": "MotoGP"}
]);
groups.add([
{"content": "New21", "id": "SomeSort", "value": 14, className:'touringcars'}
]);
var options = {
groupOrder: function (a, b) {
return a.value - b.value;
},
groupOrderSwap: function (a, b, groups) {
var v = a.value;
a.value = b.value;
b.value = v;
},
orientation: 'both',
editable: true,
selectable: true,
groupEditable: true,
}