I am attempting to change the icon of the event clicked on, and restore the 
previous events icon.

I am ok with the first part, but have been unable to access the icon of the 
previous event to change it! 

Sorry I have seen lots of examples (particularly from Mike Nosal) which 
almost get me there, but not quite.

Code is as follows:

 <script type = "text/javascript">      // script to override the default 
bubble EventPainter script
                  Timeline.OriginalEventPainter.prototype._showBubble = 
function (x, y, evt) {
                      document.getElementById('bob').innerHTML = "";

                      // Get previous Icon from storage
                      var objHiddenfield = document.getElementById("<%= 
currIcon.ClientID%>");
                      var prevIcon = objHiddenfield.value           // ok

                      // Get previous Id from storage
                      var objHiddenfield = document.getElementById("<%= 
currId.ClientID%>");
                      prevId = objHiddenfield.value             // ok
 
                      // Get current icon  and ID
                      currentIcon = evt.getIcon();              // ok
                      currentId = evt.getID();                  //ok

                      // Here with Current Icon and Id; and previous Icon 
and Id

                      // Restore previous icon 

                      // First get the EventSource object for previous event

                      var es = tl.getBand(0).getEventSource();

                      X = es.getEvent(prevId);

                      alert(X)                          // shows [object 
Object]

 //???    HOW DO GET/CHANGE icon of this event        ?????


                      // Save current Icon and ID   
                      document.getElementById('<%= 
currIcon.ClientID%>').value = currentIcon document.getElementById('<%= 
currId.ClientID%>').value = currentId

                      // Change icon of current event to rainbow
                      
evt.setIcon("http://testtlc.timelinecontinuum.com/icons/rainbow.png";);

                      var themeBubble = this._params.theme.event.bubble;    
                      // get the parameters for creating the bubble
                      evt.fillInfoBubble(bob, this._params.theme, 
this._band.getLabeller());      // add content to the div. This will be the 
content of the bubble.

                      tl.paint();
                  };
               </script>


Spent a lot of time on this and I believe it shouldn't be as hard as I've 
made it!!


TIA

Andrew McGurk

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

Reply via email to