RasterControl.rasterControl

Access: readonly
Type: expando
An expando added to the DOM element referenced by the RasterControl's controlBox property (the RasterControl's controlBox points to the containing element of any RasterControl object: i.e. DIV, SPAN, TR, etc.)

Note: The rasterControl is an expando of the controlBox DOM element, NOT a property of RasterControl object!

The rasterControl expando of the controlBox element is used to find what the control object is parent to any DOM element nested inside a RasterControl. For example if a 'click' event happen in an element nested inside a RasterControl, you can find the RasterControl object enclosing the area where the event happened by searching up the DOM tree starting at the element where the 'click' event happened until you find a parent element with a rasterControl expando (i.e. the rasterControl expando is a pointer back to the RasterControl instance).

Example:
function myClickHandler( event )
{
    // get the element where the event happened
    var element = Raster.srcElement( event );

    // starting at 'element', look up the DOM tree
    // for a parent with a 'rasterControl' expando
    // and return the expando's value
    var rasterControl =
           Raster.findParentExpando(element, "rasterControl");

    // Did we find a match?
    if ( rasterControl!=null )
    {
        // yes: do something with the control object
        rasterControl.setVisible( false );
    }
    else
    {
        // no: the event did not happen inside
        // a raster control
    }
}
See also:
Raster.findParentExpando()
Raster.findParentWithExpando()
Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López