我正在尝试根据名为 reduction 的 itme 属性的值来更改时间线项目的颜色。下面是数据构建和更改类的尝试。项目类别不会改变。
/// items.add({ id: eventid, group: line, flight: flight, opsday: opsday, orig: orig, dest: dest, start: today + "T" + dept + ".000Z", end: 今天+ "T" + arrt + ".000Z",内容:flight + " " + "
[" + orig + "-" + dest +"]",标题:"id:"+ boxid + " / plan:" + planid1 + " / " + dept.substring(0,5) + "-" + arrt.substring(0,5) + "("+opsday+")"+first+last+reduction,planid1:planid1,className:" original", style: "color: gray", reduction: reduction, });
//console.log(items.reduction);
if (items.reduction>0) {
items.className="reduced";
console.log("reduced" + flight + items.className);
}
}