2012-09-11 44 views
0

我想對夫婦的自定義字段添加到事件的數據源,是這樣的:微笑時間軸小部件添加自定義字段

{"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"} 
    ] 
} 

然後檢索customField_1customField_2在showBubble事件,像這樣:

Timeline.OriginalEventPainter.prototype._showBubble = function(x, y, evt) { 

     var cust1 = evt.getCustom1(); 
     var cust2 = evt.getCustom2(); 
} 

是否可以添加這些get方法,以及如何去解決它?

回答