2

I am using FullCalendar (1.5.2), jQuery (1.8.1), but the older ColdFusion 8.

The issue I am having is how to properly pass the start and end dates for the current calendar month to a cfc using proxy.

The calendar displays, however, the json results do not display. I suspect it is how the start and end dates should be passed to the proxy entry.

Here is the code snippet.

<cfajaxproxy cfc="xxx.ScheduleEvents" jsclassname = "schEvents">
<script type="text/javascript">
  var date = new Date();
  var d = date.getDate();
  var m = date.getMonth();
  var y = date.getFullYear();
  var jEvents = new schEvents();

  jQuery('#calendar').fullCalendar({
    header:  {
        left:  'prev,next today',
        center:  'title',
        right:  'month, basicWeek, basicDay'
     },
     editable:  true,
     events:  jEvents.getEvents()
      });
   });
</script>

I have tested the function and it works using cfinvoke and createobject, returning correct information in the correct json format for fullcalendar. The only issue that I have is how is start and end passed to the cfc in this aspect. Am I to place it as params in () for getEvents or what?

Any help would be greatly appreciated.

vasquezmi
  • 41
  • 2
  • 5
  • If the getEvents function is expecting those arguments, trying the thing you were wondering about it the first thing I would do. – Dan Bracuk Feb 07 '13 at 23:55
  • Do you not have access to the xxx.ScheduleEvents.cfc to determine what parameters it can take? – BKK Feb 08 '13 at 00:34
  • I have access to the cfc and method. They take the start and end date that should be coming from FullCalendar, however, I am having a hard time getting the start and end params passed to the cfc. I was able to test the cfc using cfinvoke and createObject on a test page. – vasquezmi Feb 09 '13 at 02:29

1 Answers1

0

I haven't used cfajaxproxy, but whenever you are serializing to JSON you need to watch out for case sensitivity.

<cfset event.id = 4 />
<cfset event["title"] = "something" />

Once that is serialized to JSON, it becomes event.ID and event.title, i.e. using dot notation on structs, all the keys end up being upper cased.

I certainly remember running into that issue when I worked with that plugin and I also remember having to javaCast something to an int, but I don't know if that is still the case with that plugin.

emeier
  • 111
  • 2
  • The JSON that is returned is compliant and in order with what fullcalendar expects. I suspect that the issue is with how to pass the start and end params to the proxied method. – vasquezmi Feb 09 '13 at 02:30
  • I used cfinvoke to return the json format. Not sure if the format is causing the issue. Also, I have seen where you can pass arguments to the cfc within the url manually. Meaning I actually type the cfc info (http://..../mycfc.cfc?method=myMethod&argument1=abc&argument2=xyz. The JSON results from cfinvoke encapsulates the column/data pair in double quotes with the exception of the ID and allDay items. Is this the issue? – vasquezmi Feb 13 '13 at 17:41
  • ~Bump~ any suggestions on calling function. I created a button with an alert to call the function and it passes the data. However, still wondering how to call it as a function in fullcalendar. – vasquezmi Feb 19 '13 at 18:57