ExtJS에서 그림 스트리밍

3980 단어 ExtJs
코드는 다음과 같은 MVC 모드를 사용합니다.
controller층
if (panelsArray.length == 0) {
            var editPropertyData = Ext.widget('ContractFind').show();
            var form = editPropertyData.down('form');
            form.getForm()
                    .loadRecord(grid.getSelectionModel().getSelection()[0]);
            
                    
            var conid = select.get('conid');
            var conthistoryreason = select.get('conthistoryreason');
            
            var flag = document.getElementById('div333');
                                        if(flag==null){
                                            //    div
                                            var div = document.createElement('div');
                                            //  div   
                                            div.innerHTML = conthistoryreason; //       ,     .
//                                            div.style.background = "blue";//  css  ,s      \
                                            div.style.overflow = "auto";//  css  ,overflow:auto\
                                            div.id='div333';
                                            var bo = document.body;//  body  .
                                            //     body 
                                            bo.insertBefore(div,bo.lastChild);
                                            
                                        }
            
            //       ,     
            var StoreTP = Ext.getCmp('pattstoidfj').getStore();
            params = " and o.archiveid="+conid+" and o.pattachmenttype=2";
            params = escape(params);
            StoreTP.on("beforeload", function(store, options) {
                    Ext.apply(store.proxy.extraParams, {
                                params : params
                            });
                });
            StoreTP.load();        
                    
                    
//            editPropertyData.show();
}

뷰 레이어
function showimg(o){
    
            var editPropertyData = Ext.widget('ImgFind');
            
            Ext.getCmp("imglooks")
                    .setSrc(o.src);
            editPropertyData.show();
        
}

//        ExtJs DataView,      view     ,             。   html    。
//“var imageTpl”         
var imageTpl = new Ext.XTemplate(
'<tpl for=".">',
       '<div style="margin-bottom: 10px; margin:18px;float:left" class="thumb-wrap">',
          '<img width="150" onclick="showimg(this)" height="180" src="'+getRootPath()+'/images/property/'+'{pattachmentimgpath}">',
          '<br/><span align="center">{pattachmentname}</span>',
        '</div>',
           '</tpl>'
);

Ext.define('hwxx.view.find.PropertyFind', {

。。。。。

xtype: 'tabpanel',
                    activeTab: 0,
                    items: [
                    {
                      xtype: 'panel',
                            title: '     ',
                            items: [
                                {
                                    xtype: 'dataview',
                                    height: 217,
                                    store:'PattachmentStoDBTP',
                                    id:'pattstoidtp',
                                    name:'dbimgstp',
                                    autoScroll: true,
//                                    title : '    ',
                                    tpl: imageTpl,
                                    itemSelector: 'div.thumb-wrap',
                                    emptyText: '       '
}
}
}

좋은 웹페이지 즐겨찾기