Scroll Lateral GridPanel ExtJs

1

Good morning, I have the following problem:     In the following code I need to show the side scroll for two of the grid panels, and no matter how many tests I do, I do not know how to solve it. Any ideas?

 oThis.fileGrid = Ext.create('Ext.grid.Panel',{
                id: oThis.CLASS_NAME+'_fileGrid',
                header: false,
                hideHeaders: true,
                autoScroll: true,
                viewConfig : {
                   style : {
                    overflow : 'auto',
                    overflowX : 'hidden'
                  }
                },
                store: oThis.fileStore,
                  columns:[{
                    dataIndex: 'icon',
                    flex: 2,
                    renderer: function(value, p, record) {
                        if(record.data.fileName.indexOf(".")<0){
                            return '';
                        }
                        if(record.data.fileName.indexOf(".pdf")>-1){
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/PDF.png" style="height:2.5em"></img>';
                        } else if(record.data.fileName.indexOf(".doc")>-1 || record.data.fileName.indexOf(".docx")>-1){
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/ms-word.png" style="height:2.5em"></img>';
                        } else if(record.data.fileName.indexOf(".xls")>-1 || record.data.fileName.indexOf(".xlsx")>-1){
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/ms-excel.png" style="height:2.5em"></img>';
                        } else if(record.data.fileName.indexOf("ppt")>-1 || record.data.fileName.indexOf(".pptx")>-1){
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/ms-ppt.png" style="height:2.5em"></img>';
                        } else if(record.data.fileName.indexOf(".png")>-1 || record.data.fileName.indexOf(".jpg")>-1){
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/jpg-icon.png" style="height:2.5em"></img>';
                        } 
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/file-icon.png" style="height:2.5em"></img>';
                    },
                    listeners: {
                        click: function(dv, record, item, index, e) {
                            if(dv.store.data.items[item].data.idAlfresco != -1){
                                oThis.showAttachment(dv.store.data.items[item].data.idAlfresco);
                            }
                        }
                    }
                  },{
                    dataIndex: 'name',
                    flex: 15,
                    renderer: function(value, p, record) {
                        if(record.data.fileName.indexOf(".")<0){
                            return '<b>'+COREProxy.languageMng.getText(oThis.CLASS_NAME,"noAdjuntos")+'</b>';
                        }
                        p.tdAttr = 'data-qtip="'+record.data.fileName+'"';
                        return '<b>'+COREProxy.languageMng.getText(oThis.CLASS_NAME,"fileName")+':&nbsp</b>'+record.data.fileName;
                    },
                    listeners: {
                        click: function(dv, record, item, index, e) {
                            if(dv.store.data.items[item].data.idAlfresco != -1){
                                oThis.showAttachment(dv.store.data.items[item].data.idAlfresco);
                            }
                        }
                    }
                },{
                    id:oThis.CLASS_NAME+'_attachmentDeleteColumn',
                    hidden: this.hasComponentPermission(oThis.CLASS_NAME+'_attachmentDeleteColumn'),
                    dataIndex: 'delete',
                    flex: 1,
                    renderer: function(value, p, record) {
                        if(record.data.fileName.indexOf(".")<0){
                            return '';
                        }else{
                            return '<img src="'+COREProxy.blackboard.urlbaseApp + '/img/close.png" style="cursor:pointer"></img>';
                        }               
                    },
                    listeners: {
                        click: function(dv, record, item, index, e) {
                            if(dv.store.data.items[item].data.idAlfresco != -1){
                                oThis.deleteAttachment(dv.store.data.items[item].data.idAlfresco, oThis.tipoAdjunto);
                            }
                        }
                    }
                }]
            });
    
asked by exferos 24.08.2017 в 09:48
source

1 answer

0

I have managed to fix my problem, the code I had published is insufficient to solve this case since that grid panel is the son of another panel which means that obviously the autoscroll was not going to work. When I realized and put the father the autoscroll: true to worked exactly as he wanted. Sorry for the inconvenience.

    
answered by 24.08.2017 / 13:30
source