Lotus Notes FAQ Visit Our Sponsor!

How do you change the twistie graphics?

Until Domino provides this internally, you can use JavaScript to do this. Create a $$ViewTemplate and add this code so it runs after the view page is loaded:

<SCRIPT LANGUAGE=JavaScript>
  var i, nullcount, expand, collapse; 

  expand = new Image();
  expand.src = '/icons/expview.gif'; // place URL to your image for expand (but don't name it expand.gif)
  collapse = new Image(); 
  collapse.src = '/icons/colview.gif'; // place URL to your image for collapse (but don't name it collapse.gif)

  nullcount = 1; // initialize nullcount to non-zero so it enters the while loop.

   // while loop tests if all the images are loaded by the browser
  while (nullcount) {
     // Reset nullcount which counts number of images remaining to download.
    nullcount = 0;
     // document.images is collection of all images (<IMG> tags) on the document
     // it has length attribute representing the image count.
    for (i = 0;  i < document.images.length;  i++) {
      if (document.images[i].src == null)   // src is property storing image url
        nullcount++;
      else {
        if (document.images[i].src.indexOf('expand.gif') > 0)        // checks expand
          document.images[i].src = expand.src; 
        else if (document.images[i].src.indexOf('collapse.gif') > 0) // checks collapse
          document.images[i].src = collapse.src;
      }
    }
  }
</SCRIPT> 


Applies to Notes Versions: 4 4.5 4.6 5
Last Modified: August 23, 2000