我想在事件数据源中添加几个自定义字段,例如:
{"events":
[
{"isDuration": "true",
"description": "my description
"color": "#ffcc00",
"image": "/images/my-img.jpg",
"link": "http://www.google.co.uk",
"icon": "/images/red-ico.png",
"end": null,
"title": "my title",
"start": "2012,09,30",
"textColor": "#777",
"customField_1": "abc"
"customField_2" : "def"}
]
}
然后在showBubble事件中检索 customField_1 和 customField_2 ,如下所示:
Timeline.OriginalEventPainter.prototype._showBubble = function(x, y, evt) {
var cust1 = evt.getCustom1();
var cust2 = evt.getCustom2();
}
是否可以添加这些get方法,我将如何进行呢?