0
votes

I am new to ExtJs and I found myself unable to use a grid:

As the header doesn't render correctly I am unable do sort, resize or even notice when I click on a grid item.

The grid code is this:

Ext.define('Simviab.view.empresa.SociosGrid', {
extend: 'Ext.grid.Panel',
alias: 'widget.sociosgrid',


store:  'sociosempresa',            
width: 400,
height: 200,
columns: [
    {text: 'Nome do Socio', dataIndex: 'TE_RAZAO', flex:1},
    {text: 'Cargo/Função', dataIndex: 'TS_CARGO', width: 100},
    {text: '%', dataIndex: 'TS_PERCENTUAL', width: 100},
    {text: 'Participação no Capital Social', dataIndex: 'TS_PARTICIPACAO', width: 150}
]


});

I am rendering it onto a window, like this:

Ext.define('Simviab.view.empresa.SociosWindow', {
extend: 'Ext.window.Window',

alias: 'widget.socioswindow',

title: 'Adicionar sócios',
modal: true, 
autoShow: true,

iconCls: 'icon-form',

width: 400,
height: 400,    

items:[
    {
        xtype:'label',
        text: 'Adicionar sócios a Empresa: ',
        itemId: 'empresaNome',
    },{
        xtype: 'fieldset',
        title: 'Capital Social',
        items: [
            {
                xtype: 'textfield',
                fieldLabel: 'Nome do Sócio',
                maxLength: 50,
                allowBlank: false
            },
            {
                xtype: 'textfield',
                fieldLabel: 'Cargo/Função',
                maxLength: 50,
                allowBlank: false
            },
            {
                xtype: 'numberfield',
                fieldLabel: 'Percentual de participação',
                maxValue: 100,
                minValue: 1,
                allowBlank: false,
                step: 0.5
            }
        ]

    },{
        xtype: 'sociosgrid'
    }
]

});

Where I am going wrong?

1
I think your screenshot is wrong? - koni
No it's not. Believe me... This is all I got... The bottom thing that looks like a simple label and a box is what my grid rendered. The difference is that I added some columns after this screenshot. - Vinícius Hacebe
Underneath height try adding layout: { type: 'fit' }, - JesseRules
No console errors karlipoppins / Adding layout: {type: 'fit'}, didn't change anything :( @JesseRules - Vinícius Hacebe

1 Answers

0
votes

I finally found out that the problem was with the app folder generated by Sencha CMD, now I have created a new app and put my code there and now it's working good...

The strange thing is that I had tried to create another app before with no success!