- Ext.Image=Ext.extend(Ext.Component,{
- initComponent:function ()
- {
- },
- onRender:function (ct, position)
- {
- var a= document.createElement( 'A' );
- a.id = this .id;a.href= "javascript:void(0)" ;
- var el = document.createElement( 'IMG' );
- el.src=this .src+ '?' +Math.random();
- a.appendChild(el);
- this .el = Ext.get(ct.dom.appendChild(a));
- if ( this .autoRefresh)
- this .el.on( 'click' , this .onClick, this );
- },
- onClick: function (e){
- this .el.first().dom.src= this .src+ '?' +Math.random();
- }
- })
-
Ext.reg('ximg'
,Ext.Image);
使用:
- {
- xtype:'ximg' ,
- src:'http://www.java125.cn/common/getcode.asp' ,
- autoRefresh:true
- }
6566

被折叠的 条评论
为什么被折叠?



