extjs - Wrap a database stored image inside an Ext.Img component -


so have images stored in database. kept blobs, not path physical location. can access them via: http://example.com/data/pagemedia?id=%someid%.

but when want wrap image in ext.img:

ext.create('ext.img', {     src: 'http://example.com/data/pagemedia?id=' + someid,     renderto: ext.getbody() }); 

it doesn't render image.

it works fine pure html, though:

<img src="http://example.com/data/pagemedia?id=%someid%"/> 

should use ajax request or else , set src dynamically?

here working example:

 ext.create('ext.img',{       src : 'gallery/getimage/' + imageid,       renderto: 'cat-img' // in case ext.getbody()  }); 

notice how create image url. if someid js variable , not hardcoded, have write:

ext.create('ext.img',{     src : 'http://mysite.com/data/pagemedia?id='+someid,     renderto: ext.getbody() }); 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -