2011/9/15 Matthew Bramer <[email protected]>:
> Hey guys,
> I really appreciate your time.  I'm definitely leaning towards a callback,
> because I think this will handle my other question about options.FormatData
> as well.  Here is a sample call into my module:
> ***********************************************************************
> jsllc.LoadDDL("Master List", '#NewEFM',{
> Query: "<Query><Where><Neq><FieldRef Name='ID' /><Value Type='Counter'>" +
> PID + "</Value></Neq></Where><OrderBy><FieldRef Name='EFMFullNameDDL'
> Ascending='True' /></OrderBy></Query>",
> ViewField: "EFMFullNameDDL",
> Split: true
> });
> ***********************************************************************
> I've heard of callbacks and I know I use them all over in my jQuery code,
> but to date I have not written one, nor do I understand much about them.
>  When I make the LoadDDL call, I am passing in a list name and a selector.
>  When the module call is finished, this ddl will be automatically populated
> with the results of the API call.  I wrote this module so I could cache the
> result set.  Prior to this, the API was being called each time.
> I think I'm close to an "AH-HA" moment with these callbacks, so if anyone
> wants to spill the beans on them in terms within my skillset, I'm all ears!
> Cheers,
> Matt

A callback is a function that is called when for example an event
happens. Just think of the onclick even handler. It is a callback,
that will be called when a click event happens. Same goes for AJAX
loading. You specify a callback, that will be called when a the AJAX
data is loaded. You even specify one callback for the 'complete'
attribute, that will be called when the AJAX loading is 'complete'.


-- 
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to