Problem calling a function as Modal contents after updating to 2.2.3

Hi all,

Just updated to 2.2.3 as I needed the Firefox overlay scrolling fix, and now its spitting the dummy with having a function passed as the contents option.

Here's the code,

i'm assigning the behaviour to a calendar with the first one...

function fnInitLinks(y,m,d){ for(i=d;i<=31;i++){ var sDate = y+'-'+(m>9? m :'0'+m)+'-'+(i>9? i :'0'+i); new Control.Modal('d-' + sDate,{ contents: fnDialogueWindow(sDate) }); } }

... and attaching an ajax request here

function fnDialogueWindow(sDate){ return function(){ new Ajax.Request('/eventdate/dialogue/'+sDate,{ onComplete: function(request){ this.update(request.responseText); }.bind(this) }); } }

and i'm now getting this error...

html has no properties update(undefined)control.modal.2.2... (line 352)

It works fine with the 1.2.12 script

All advice welcome!

Posted October 9th, 2007 at 8:11am by rich

sorry, forgot to

 the code!

function fnInitLinks(y,m,d){ for(i=d;i9? m :'0'+m)+'-'+(i>9? i :'0'+i); new Control.Modal('d-' + sDate,{ contents: fnDialogueWindow(sDate) }); } }
function fnDialogueWindow(sDate){ return function(){ new Ajax.Request('/eventdate/dialogue/'+sDate,{ onComplete: function(request){ this.update(request.responseText); }.bind(this) }); } }

Posted October 9th, 2007 at 8:14am by rich

ok i've made that a bit more readable.

anyone out there had any similar experiences or can suggest an alternative approach to this?


function fnInitLinks(y,m,d){
  for(i=d;i9? m :'0'+m)+'-'+(i>9? i :'0'+i); 
    new Control.Modal('d-' + sDate,{ 
      contents: fnDialogueWindow(sDate) 
    }); 
  } 
}
function fnDialogueWindow(sDate){ 
  return function(){ 
    new Ajax.Request('/eventdate/dialogue/'+sDate,{ 
      onComplete: function(request){ 
        this.update(request.responseText); 
      }.bind(this) 
    }); 
  } 
}

Posted October 10th, 2007 at 3:33am by rich

Login or Register to Post