Tip

Web View with "Clickable" Categories and Twisties

Ever wanted a categorized view where the categories themselves are "clickable"? Tired of those ugly twisties? Here is how to do it.


Put this code in your category columns in the view. This will make the category "clickable".

"[" + "<script>document.write("<a href='"+document.links[document.links.length-1]+"'>" + MyCategoryFieldName + "</a>");</script>" + "]"

Want to get rid of the twisties? Extend the code to look like this.

"[" + "<script>document.write("<a href='"+document.links[document.links.length-1]+"'>" + MyCategoryFieldName + "</a>");" +
"if(document.images[document.images.length-1].src.indexOf("expand.gif") != -1) {" +
"document.images[document.images.length-1].src="/icons/ecblank.gif";}"+
"if(document.images[document.images.length-1].src.indexOf"collapse.gif") != -1){" +
"document.images[document.images.length-1].src="/icons/ecblank.gif";}</script>" + "]"

In this example, the twisties are replaced by the ecblank gif; you could of course use any gif of choice.

This was first published in March 2001

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.