[jQuery] AjaxCFC (paging Rey Bango...)
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
pre
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This is great, Chris. Thanks a bunch for
taking the time to send it. <o:p></o:p></span></font>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I’m sure I’ll have questions
as I progress…<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>paul<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>
<hr size=3 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Christopher Jordan
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, February 06, 2007
11:02 AM
<b><span style='font-weight:bold'>To:</span></b> jQuery Discussion.
<b><span style='font-weight:bold'>Subject:</span></b> Re: [jQuery] AjaxCFC
(paging Rey Bango...)</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font>
</div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Paul,
use "serialization: json" in your ajaxCFC call, and when your query
is returned it will be valid JSON (which is valid JavaScript). Then you to an
eval of that JSON string and it will become a JavaScript object that you can
use like this:
FlexOrderData = eval("(" + data + ")");
//dump(FlexOrderData);
var myRecordCount = FlexOrderData.recordcount;
var myTempDate, myBackgroundColor, myShiftDate, myCalendarCell, myCells, myKey,
myCellIndex;
var myjQueryString = "";
var myContractDates = {};
for(i = 0; i < myRecordCount; i++){
myShiftDate =
CFJS.ListFirst(FlexOrderData.data.SHIFTDATE[i],".");
myShiftDate =
FlexOrderData.data.SHIFTDATE[i].split(".")[0];
myOrderID = FlexOrderData.data.ORDERID[i];
myAssignRep = FlexOrderData.data.ASSIGNREP[i];
myAssignDateTime
= FlexOrderData.data.ASSIGNDATETIME[i];
myEmployeeConfirmRep =
FlexOrderData.data.EMPLOYEECONFIRMREP[i];
myEmployeeConfirmDateTime =
FlexOrderData.data.EMPLOYEECONFIRMDATETIME[i];
myClientConfirmRep
= FlexOrderData.data.CLIENTCONFIRMREP[i];
myClientConfirmDateTime
= FlexOrderData.data.CLIENTCONFIRMDATETIME[i];
...
}
In my example above "FlexOrderData" is a query that I returned that
was serialized using JSON. CFJSON, which Rob uses in AjaxCFC, automatically
returns Queryname.RecordCountand Queryname.ColumnList along with the data in
order to keep it feeling like CF. So in the example above you can see that I
first evaluate the JSON, after which my "queryname" is now
"FlexOrderData".
One of the things to keep in mind is that **case is NOT preserved**.
Recordcount is 'recordcount' and all field names are UPPER-CASED. I hope this
along with my example are helpful.
Below is an example AjaxCFC call in jQuery (Rob, Rey... correct me if I'm wrong
here or the syntax has changed)
$.AjaxCFC({
url: "/Path/To/My.cfc",
method: "MyMethod",
data: ,
unnamedargs: false,
serialization: "json",
success: function(data) {
dump(data); // dump is not part of
AjaxCFC.
MyQueryName = eval("(" +
data + ")");
//... etc., etc.
}
});
Again, I hope all this helps.
Cheers,
Chris
</span></font>
Paul wrote: <o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><!--[if gte mso 9]><xml>
<u1:shapedefaults u2:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<u3:shapelayout u4:ext="edit">
<u3:idmap u4:ext="edit" data="1"/>
</u3:shapelayout>
</xml><![endif]-->Chris, <u5:p></u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u5:p> </u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I just realized that the zip I grabbed from
AjaxCFC was the stable (not jQuery alpha) release. I just tapped into the
SVN repo and am now looking at the jQuery examples.<u5:p></u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u5:p> </u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It seems there is only one straight-up
jQuery example—the other three seem to be illustrating compatibility with
DWR methods. How does one handle a CF query object without the DWR
methods and syntax? <u5:p></u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u5:p> </u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks,<u5:p></u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u5:p> </u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Paul<u5:p></u5:p></span></font><o:p></o:p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u5:p> </u5:p></span></font><o:p></o:p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>
<hr size=3 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> <a href="mailto:discuss-bounces@jquery.com">discuss-bounces@jquery.com</a>
[<a href="mailto:discuss-bounces@jquery.com">mailto:discuss-bounces@jquery.com</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Christopher Jordan
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, February 06, 2007
10:13 AM
<b><span style='font-weight:bold'>To:</span></b> jQuery Discussion.
<b><span style='font-weight:bold'>Subject:</span></b> Re: [jQuery] AjaxCFC
(paging Rey Bango...)</span></font><o:p></o:p>
</div>
<u5:p></u5:p>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><u5:p> </u5:p><o:p></o:p></span></font>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Paul,
Have you downloaded the AjaxCFC for jQuery package from RIA Forge? It contains
examples.
Hope this helps,
Chris
</span></font>
Paul wrote: <u5:p></u5:p><o:p></o:p>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>About 2 weeks Rey Bango posted that AjaxCFC had been
updated to implement jQuery 1.1, but apparently the ajaxCFC demos have not yet
been updated to reflect the change. Since I’m too inexperienced to
fumble my way through it properly, can anybody point me to some basic
getting-started information regarding ajaxCFC and jQuery together?<u1:p></u1:p></span></font><u5:p></u5:p><o:p></o:p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><u5:p> </u5:p><o:p></o:p></span></font></pre><pre
style='text-align:center'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre
style='text-align:center'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre
style='text-align:center'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>
<hr size=4 width="90%" align=center>
</span></font></pre><pre style='text-align:center'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre
style='text-align:center'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><u5:p> </u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>_______________________________________________<u5:p></u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>jQuery mailing list<u5:p></u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="mailto:discuss@jquery.com">discuss@jquery.com</a><u5:p></u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://jquery.com/discuss/">http://jquery.com/discuss/</a><u5:p></u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <u5:p></u5:p><o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>
<o:p></o:p></span></font>
<u5:p></u5:p><pre><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>-- <u5:p></u5:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.cjordan.info">http://www.cjordan.info</a><u5:p></u5:p><o:p></o:p></span></font></pre><pre
wrap=""><font size=2 color=black face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></pre><pre style='text-align:center'><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>
<hr size=4 width="90%" align=center>
</span></font></pre><pre><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>_______________________________________________<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>jQuery mailing list<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="mailto:discuss@jquery.com">discuss@jquery.com</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://jquery.com/discuss/">http://jquery.com/discuss/</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>
<o:p></o:p></span></font>
<pre><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>-- <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.cjordan.info">http://www.cjordan.info</a><o:p></o:p></span></font></pre></div>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/