rem: var oldTreeChildren = document.getElementById( childrenName ); 
context: function refreshEventTree( eventArray, childrenName, Categories ){   // get the old tree children item and remove it      var oldTreeChildren = document.getElementById( childrenName );   while( oldTreeChildren.hasChildNodes() )      oldTreeChildren.removeChild( oldTreeChildren.lastChild );   // add: tree item, row, cell, box and text items for every event   for( var index = 0; index < eventArray.length; ++index )   {      var calendarEvent = eventArray[ index ];            // make the items      var treeItem = document.createElement( "listitem" );            if( Categories != false )         treeItem.setAttribute( "id", "unifinder-treeitem-"+calendarEvent.id );      else         treeItem.setAttribute( "id", "search-unifinder-treeitem-"+calendarEvent.id );      treeItem.event = calendarEvent;      treeItem.setAttribute( "ondblclick" , "unifinderDoubleClickEvent(" + calendarEvent.id + ")" );      //treeItem.setAttribute( "onclick" , "unifinderClickEvent(" + calendarEvent.id + ")" );            var treeCell = document.createElement( "listcell" );      treeCell.setAttribute( "flex" , "1" );      treeCell.setAttribute( "crop", "right" );            var image = document.createElement( "image" );      image.setAttribute( "class", "unifinder-calendar-event-icon-class" );            if ( calendarEvent.alarm )       {         image.setAttribute( "alarm", "true" );      }      else if( calendarEvent.recur == true )      {         image.setAttribute( "recur", "true" );      }      var treeCellHBox = document.createElement( "hbox" );            treeCellHBox.setAttribute( "flex" , "1" );      treeCellHBox.setAttribute( "class", "unifinder-treecell-box-class" );      treeCellHBox.setAttribute( "crop", "right" );      treeCellHBox.setAttribute( "align", "center" );      var treeCellVBox = document.createElement( "vbox" );      treeCellVBox.setAttribute( "crop", "right" );      treeCellVBox.setAttribute( "flex", "1" );      var text1 = document.createElement( "label" );      text1.setAttribute( "crop", "right" );            var text2 = document.createElement( "label" );      text2.setAttribute( "crop", "right" );      // set up the display and behaviour of the tree items      // set the text of the two text items            text1.setAttribute( "value" , calendarEvent.title );            var eventStartDate = new Date( calendarEvent.start.getTime() );      var eventEndDate = new Date( calendarEvent.end.getTime() );      var startDate = formatUnifinderEventDate( eventStartDate );      var startTime = formatUnifinderEventTime( eventStartDate );      var endTime  = formatUnifinderEventTime( eventEndDate );            if( calendarEvent.allDay )      {         text2.setAttribute( "value" , "All day on " + startDate + "" );      }      else      {         text2.setAttribute( "value" , startDate + " " + startTime + " - " +  endTime );      }                  // add the items      if ( calendarEvent.title )       {         treeCellVBox.appendChild( text1 );      }      treeCellVBox.appendChild( text2 );            treeCellHBox.appendChild( image );      treeCellHBox.appendChild( treeCellVBox );            treeCell.appendChild( treeCellHBox );      treeItem.appendChild( treeCell );      oldTreeChildren.appendChild( treeItem );      //you need this for when an event is added.      if( gCalendarWindow.EventSelection.isSelectedEvent( calendarEvent ) )         oldTreeChildren.addItemToSelection( treeItem );   }  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/cb4001c666f91beb526cdc96ef86d6d27e121e07/unifinder.js/clean/calendar/resources/content/unifinder.js