Question : How do I show user presence (Live Messenger) in a Sharepoint (WSS 3.0) calculated column.

Hi - I am trying to show a presence icon within a calculated column. I have previously used calculated columns to show images and I am close but the indicator that shows does not look like it has received any data.
The calculated formula that I am using is :
="<DIV><span><img border='0' height='12' src='/_layouts/images/imnhdr.gif\' onload='IMNRC('"&[E-mail Address]&"')' ShowOfflinePawn='1' alt=' ' id='user_presence_icon'/></span></DIV>"
This shows a blank square icon and if I hover over it then a small blank box appears. I can see presence indication on the same page using the built in 'Name with presence' column.
I have employed a separate piece of code embedded on the page which allows the calculated column to be processed as HTML and I know this works and displays a regular image. I can provide details of this code if required.
 
 
sharepoint view showing problem column
325520
 

Answer : How do I show user presence (Live Messenger) in a Sharepoint (WSS 3.0) calculated column.

Instead of:
    var parentTxt = $(this).parent('span.folder').text();

use:
 var parentTxt = $('span.folder', $(this).closest("ul").parent() ).text();

which basically states:
look for span.folder WITHIN $(this).closest("ul").parent().

If you take a closer look at your markup, it should be clear that when you click on Search, $(this).closest("ul") refers to <ul id="test"> and its parent is the li that contains both, <ul id="test"> AND <span class="folder">.

So essentially this:
$(this).closest("ul").parent()

refers to the first <li> in <ul id="treemenu">. So, to summarize:

$('span.folder', $(this).closest("ul").parent() ).text();
says:
look for span.folder within the li in <ul id="treemenu">
Clear?
Random Solutions  
 
programming4us programming4us