Extjs Tabpanel and gridview

Asked

Viewed 108 times

0

I believe it’s a very simple question but I’ve tried everything and it hasn’t solved.

A gridview in the tabpanel is not displaying the pagingtollbar, as there is a lot of line on the grid past the view area. The tabpanel scroll doesn’t work, and I can’t access the navigation buttons.

Without setting the grid height in hand how to adjust to the screen size automatically? No scroll from the gridview scroll only tabpanel.

Thank you

Code of the grid

Ext.define('ImpPdf.view.GridView', {
extend: 'Ext.grid.Panel',

requires: ['Ext.toolbar.Paging'],

alias: 'widget.gridV',
//title: 'Importação',

store: 'GridStore',
selType: 'checkboxmodel',

selModel: {
    checkOnly: true,
    injectCheckbox: 1
},

layout: {
    type: 'border',
    align: 'center'
},

loadMask: true,
autoScroll: true,
stateful: true,
multiSelect: true,

//height: 620,
//autoHeight: true,

viewConfig: {
    stripeRows: true,
    enableTextSelection: true,
    forceFit: true,

    //autoFill: true,
    //scrollOffset: 0
},

columns: [
    {   header: 'Id',
        dataIndex: 'id',
        sortable: false,
        width: 50,
        fixed: true
    },{
        header: "Url",
        dataIndex: 'url',
        sortable: true
    }

],
initComponent: function() {
    this.dockedItems = [
        {
            xtype: 'toolbar',
            items: [
                {
                    text: 'Importar',
                    action: 'selimp',
                    tooltip: 'Importar TXT'
                },{
                    text: 'Excluir',
                    action: 'delete',
                    tooltip: 'Deletar Registros'
                },{
                    text: 'Excluir Todos',
                    action: 'deleteAll',
                    tooltip: 'Deletar todos os Registros'
                },{
                    text: 'Transferir Dados',
                    action: 'transfDados',
                    tooltip: 'Transferencia de registros'
                }
            ]
        },{
            xtype: 'pagingtoolbar',
            dock: 'bottom',
            store: 'GridStore',
            displayInfo: true,
            emptyMsg: "Nenhum registro encontrado."
        }
    ];

    this.callParent(arguments);
}

});

Code Layout/Container/Tabpanel

Ext.define('ImpPdf.view.Main', {
extend: 'Ext.container.Container',

requires:[
    'ImpPdf.view.GridView',
    'Ext.tab.Panel'
],
xtype: 'app-main',

layout: {
    type: 'border',
    align: 'left'
},

defaults: {
    bodyBorder: false,
    //collapsible: true,
    split: true,
    bodyPadding: 0
},

items: [
{
    xtype: 'container',
    region: 'north',
    split: false,
    height: 40,
    html: '<h2>Primeiro aplicativo</h2>',
    style:{
        marginBottom: '10px',
        marginLeft: '5px',
        color: 'white'
    }
},{
    title: 'Navegação',
    region: 'west',
    floatable: false,
    margins: '5 0 0 0',
    width: 180,
    minWidth: 100,
    maxWidth: 250
},{
    //title: 'Main',
    region: 'center',
    collapsible: false,
    margins: '5 0 0 0',
    items: [{
        xtype: 'tabpanel',
        activeTab: 0,

        items:[{
            title: 'Importação',
            items: [{
                xtype: 'gridV'
            }]
        },{
            title: 'Transferencia'
        }]
    }]
}]

});

1 answer

1

Setting height automatically is a bit tricky. The simplest is to use the bootstrap

Now pro scroll work, you will have to set the autoscroll property to true in your tabpanel

autoscroll: true

after the scroll runs the content should fit itself.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.