I need to re-render an image (Ext.Image) after some events.
I found doComponentLayout function but it didn't work for me unfortunately.
How can I re-render an image which is an item of form?
I need to re-render an image (Ext.Image) after some events.
I found doComponentLayout function but it didn't work for me unfortunately.
How can I re-render an image which is an item of form?
There is a common technique to add ? and random string at the and of image's src. Server ignores this part of src but browser thinks that you are setting new src.
var originalSrc = 'http://example.com/someimg.png';
var antiCachePart = (new Date()).getTime();
var newSrc = originalSrc + '?dc=' + antiCachePart;
// now newSrc is equal to something like "http://example.com/someimg.png?dc=1352748617627"
img.setSrc(newSrc);
I haven't ever worked with Ext.Image before, but in general when we've needed to rerender an image we do one of two things: destroy and recreate the component, or put the image inside of a DataView or other template driven component and rerender the template.
doComponentLayout only applies sizing I believe, it won't regenerate the component. If you can't put the image inside of an XTemplate driven component, then destroying and recreating the component will probably be the best option.