Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:42:48+00:00 2026-06-04T16:42:48+00:00

I need a real <img> HTML tag in my view Sencha. I’ve retrieved this

  • 0

I need a real <img> HTML tag in my view Sencha.

I’ve retrieved this code from the official doc :

Ext.define('Ext.ux.Image', {
    extend: 'Ext.Component', // subclass Ext.Component
    alias: 'widget.managedimage', // this component will have an xtype of 'managedimage'
    autoEl: {
        tag: 'img',
        src: Ext.BLANK_IMAGE_URL,
        cls: 'my-managed-image'
    },

    // Add custom processing to the onRender phase.
    // Add a ‘load’ listener to the element.
    onRender: function() {
        this.autoEl = Ext.apply({}, this.initialConfig, this.autoEl);
        this.callParent(arguments);
        this.el.on('load', this.onLoad, this);
    },

    onLoad: function() {
        this.fireEvent('load', this);
    },

    setSrc: function(src) {
        if (this.rendered) {
            this.el.dom.src = src;
        } else {
            this.src = src;
        }
    },

    getSrc: function(src) {
        return this.el.dom.src || this.src;
    }
});

When i try to do setSrc, I get this error : Cannot read property ‘dom’ of undefined

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:42:51+00:00Added an answer on June 4, 2026 at 4:42 pm

    Your code is from Ext.Js 4.x docs. You should use sencha touch 2 docs.
    Please compare:
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Component

    and

    http://docs.sencha.com/touch/2-0/#!/api/Ext.Component

    They are different.

    As i understand you need real < img > tag in your view. If you use Ext.Img it will create a div container with background-image.
    I know two ways:

    1. set up tpl and data property.
    Ext.create('Ext.Component', {
      config: {
        tpl: '',
        data: {
          url: 'http://example.com/pics/1.png',
          imgClass: 'my-class'
        }
      }
    });
    
    1. set html config.
    Ext.create('Ext.Component', {
        config: {
        html: ' <img class="my-class" src="http://example.com/pics/1.png">'
        }
    });
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm asking this out of curiosity rather than due to a real need to
I need to display a real time data from MS SQL 2005. I saw
This doesn't need to be a real time solution, but are there some log
I have a situation where I sometimes need a real fullscreen view that also
I am implementing a system where I need real-time updates. I have been looking
I need help of a real C guru to analyze a crash in my
I need to find the real type of images, as a lot of times
I need to build a device emulator which can communicate over real IP address
I have hit a real problem. I need to do some Kmeans clustering for
I'm sampling a real-world sensor, and I need to display its filtered value. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.