cfcalendar opens a 'new' world
8 comments Posted by: LauraToday, Ben Forta posted an example to "Programatically change Flash Form calendar selectable ranges". At first sight, this is a nice example of using Actionscript to manipulate form controls. Reading the code a little more carefully, you can find a little gem: the word "new" is used to create a new date object. Those that tried creating new objects within ActionScript code have found that new, import, delete, createChild, loadmovie, duplicateMovieClip, AttachMovie, registerclass, createTextField, __proto__ cannot be used and writing any of those keywords would throw an "Illegal usage of ActionScript" error.
However, it seems that there are no restrictions imposed if we put a piece of code with illegal keywords in a cfcalendar. I do not know what this means, and why the cfcalendar tag does not have the same restrictions that the other tags have. If we use this now, can we be sure that the calendar will not be limited in the future to match the other tags?
I hope that the opposite happens instead. :)
8 Comments so far
Write yours<cfgrid name="dg" onChange="var a = dg.selectedItem.date.split('/');cal.selectedDate=mx.formatters.DateFormatter.parseDateString(a[1]+'/'+a[0]+'/'+a[2]);">
The code is binding a datagrid column containing string dates to a calendar selectedDate.
http://cfpim.blogspot.com
Cheers
http://cfpim.blogspot.com/2005/04/clock-timer-in-flash-cfform-opening.html
Thanks for the boost ;)
//P.
var myObject = {};
var myArray = [];
will create an object named myObject and an array named myArray.
This has worked for me to create a new event handler for my form.
First, I tried <cfcalendar name="FilterDate" ... onChange="var a = dg.selectedItem.date.split('/');cal.selectedDate=mx.formatters.DateFormatter.parseDateString(a[1]+'/'+a[0]+'/'+a[2]);">"> which didn't work.
I then tried to use the "ActionFilter() script from this site: <CFCalendar name="mycal"... onchange="applyFilter(mycal.selectedDate,mygrid,['StartDate'])"> which works, but only once ( if you click on a date, the filter has run and no records are shown in the grid)
Thanks in advance for your help!
Thanks,
Jimmy