this within its body) depends on where the caller has stored it before invoking it. When working with Infusion, there are times when you will need to interact with a library and or function that requires a "this", which is a keyword typically intended to refer back to itself. The most common example would be using a jQuery element.
For more details on the differences between "that-ist" and "this-ist" approaches, as well as the reasoning behind why Infusion employs the former, see the About this and that blog post.
A this-ist function can be declaratively bound to invokers and listeners in an IoC tree and takes the following structure:
The "this" required by the function; the object that the function will be called on. Note that this property name must include the quotes (" ").
e.g. a jQuery object
The name of the function to be called.
e.g. a jQuery function like "click"
|(optional) The argument or array of arguments to be passed into the function. This can include IoC References and expanders, in addition to strings, objects, booleans, etc.|
In the following example, a this-ist function is use to attach a listener to the
onCreate events: The jQuery
click() function of the button identified by the
"button" selector is used to bind the component's
writeText() method to the click event.
In the following example, taken from the Infusion Table of Contente comonent, this-ist functions are used to attach methods to the component object in the
In the following example, taken from the Infusion Inline Edit component, a this-ist function is used to invoke the
init function on the tinyMCE object associated with the component as a listener on the
In the following example, taken from the Infusion Pager component, a this-ist function is used to set the container's
role attribute to "application" using the jQuery