Here's the html portion:

<div id = 'calendar'>
        <script>new Ajax.Request('/cgi-bin/gen3.cgi?p=Generate_Calendar',
{   method:'get', onSuccess: function(transport){       var response =
transport.responseText || "No Response from Server";  var p_temp = new
Array();  p_temp = response.split(' ');  p_temp.each( function(p_key)
{ addCalendarElement(p_key);  }); build_action_area(); },
onFailure: function(){ alert('Lost Connection.') }   }); </script>
</div>

And the relevant JS:

<script language="javascript">
function addCalendarElement(keyVar) {
 var ni = document.getElementById('calendar');
 var newdiv = document.createElement('div');
 var divIdName = 'Con'+keyVar;
 newdiv.setAttribute('id',divIdName);
 newdiv.setAttribute('class','consultant');
 newdiv.innerHTML = '<img src="/gen3_images/indicator.gif"
alt="Loading..."  />';
 ni.appendChild(newdiv);
 Droppables.add(divIdName, {accept: 'prospect', onHover: function()
{showConsultantSchedule(keyVar)} });
 new Ajax.Updater(divIdName, '/cgi-bin/gen3.cgi?
p=Get_Consultant_Info&consultant='+keyVar, { method:'get'});
}

function showConsultantSchedule(cons) {
 new Ajax.Updater('schedule', '/cgi-bin/gen3.cgi?
p=Show_Consultant_Schedule&consultant='+cons, { method:'get'});
} </script>

I know this is simple code and not very elegant yet, but I'm just
building a prototype of the program to show the usefulness of such a
setup over our current system.  Any help would be appreciated.  I've
tried this code on both the 1.7.0 and 1.7.1b3 scripts and it still
fired constantly when there is movement in the drop zone.

On Jun 28, 5:23 pm, Tom Gregory <[EMAIL PROTECTED]> wrote:
> Two questions that may help someone better address your issue:
>
> 1. What version of Prototype/Scriptaculous are you using?
>
> 2. Can you post your code somewhere?
>
> TAG
>
> On Jun 28, 2007, at 4:12 PM, [EMAIL PROTECTED] wrote:
>
>
>
>
>
> > Actually, I did some experimenting and it is not actually firing the
> > event 10 times every time, it seems to be tied to the number of pixels
> > into the droppable that I go.  If I hold still, it will stop firing
> > but fire the moment I move the draggable, the exact number of times
> > for every pixel that I move it.  I tried the "greedy" option but it
> > looks like it only is for layered droppables and had no effect.
>
> > Chris
>
> > On Jun 28, 4:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> >> That worked, thanks for the quick lesson.  The next problem is that
> >> now when I hover over the drop, the event fires 10 times (the number
> >> of items in the prospect class total) instead of just once.
>
> >> Changed the code to:
>
> >> Droppables.add(divIdName, {accept: 'prospect', onHover: function()
> >> {showConsultantSchedule(keyVar)} });
>
> >> Thanks!
>
> >> Chris- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to