Clear Up
SharpKit Reference

Img Class

Simple helper class for easily creating image components. This renders an image tag to the DOM with the configured src.

Example usage:

var changingImage = Ext.create('Ext.Img', {
            src: '',
            renderTo: Ext.getBody()
            // change the src of the image programmatically

By default, only an img element is rendered and that is this component's primary element. If the Ext.AbstractComponent.autoEl property is other than 'img' (the default), the a child img element will be added to the primary element. This can be used to create a wrapper element around the img.

Wrapping the img in a div:

var wrappedImage = Ext.create('Ext.Img', {
            src: '',
            autoEl: 'div', // wrap in a div
            renderTo: Ext.getBody()

Namespace: Ext



Name Description
alt The descriptive text for non-visual UI description. Defaults to: ""
imgCls Optional CSS classes to add to the img element. Defaults to: ""
src The image src. Defaults to: ""


Name Description
setSrc(JsString) Updates the src of the image.
© Copyright 2005-2011 SharpKit. All rights reserved.