I did see that but that seems to imply the "ajaxProcess" function 
replaces the "success" function of a $.ajax call.  The data parameter 
would seem to be the Ajax results (json in my case), which can be 
manipulated into the format needed.  If my observations are correct, 
this solves only half my problem - the formatting side of things.

The other half of my problem is the fact that I need to dynamically 
determine the parameters to pass to the Ajax function.  Cluetip doesn't 
seem to have any way to handle this just yet, but so far I've only 
looked at the api documentation.  I'll take a look into the source code 
later tonight and see what I can tap into.

I've had some success with the onActivate function.  If I do something 
like this:

onActivate : function (e) {
   var myid = $(e).attr("id").toString().split("_")[0];
   var mydt = $(e).attr("id").toString().split("_")[1];
   $.ajax({
     async: false,
     url : "mypage.php",
     data : "id=" + myid + "&dt=" + mydt,
     success : function (json) {
       // . . . Process the results here . . .
       $("#cludtipDiv").html(processResults);
     }
   });
   return true;
}

But this now requires treating cluetip with local content (which is 
changed by the ajax call above), AND requires the ajax to run in 
synchronous mode (otherwise the correct data isn't shown until the next 
time the cluetip is shown)

And even putting my data into the trigger's ID was done just to 
accommodate cluetip - I have the same data elsewhere in the DOM, but in 
multiple places.

Please don't take any of my comments as complaints.  I'm just trying to 
work through how to get things going right.  Relying on the "rel" 
attribute (or whatever attribute is chosen) just seems counterintuitive 
to me when so many other plugins provide a callback function for this 
purpose.  Overall, I'm very happy with ClueTip - it's doing what I need. 
  Now I just have to learn how to work with it correctly.

Shawn

Karl Swedberg wrote:
> 
> Hi Shawn,
> 
> I think you'll want to use the ajaxProcess option, overriding the 
> default. From the docs at 
> http://plugins.learningjquery.com/cluetip/#options:
> 
> // process data retrieved via xhr before it's displayed
>     ajaxProcess:      function(data) {
>                         data = $(data).not('style, meta, link, script, 
> title');
>                         return data;
>     },
> 
> 
> Hope that helps.
> 
> --Karl
> _________________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
> 
> 
> 
> On Dec 9, 2007, at 4:38 AM, Shawn wrote:
> 
>>
>> I have a need to use Cluetip.  It seems to do exactly what I need,
>> except I'm not familiar enough with it to know the "right" way to
>> trigger it in my case.
>>
>> When I mouseover the trigger element (simple div), I need to extract
>> some detail from the trigger's ID, pass those details to an Ajax page,
>> get the results back, build the output, and THEN show the cluetip.
>>
>> With this extra processing needs, it would seem the "rel" attribute
>> option is not the best choice in my case.  Am I right to be thinking I
>> need to ignore cluetip until I have the processing and ajax calls 
>> completed?
>>
>> I tried a quick test with the onActivate parameter, but that's not
>> working for me...  I suspect that's my lack of experience though.
>>
>> Any tips/suggestions?  I DID examine the demos and past mailing list
>> postings regarding cluetip, but I don't see my particular situation
>> being discussed.
>>
>> Thanks for any input.
>>
>> Shawn
> 

Reply via email to